proteus  1.7.2
C/C++/Fortran libraries
superluWrappers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.28.5 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_28_5"
11 #define CYTHON_FUTURE_DIVISION 0
12 #include <stddef.h>
13 #ifndef offsetof
14  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
15 #endif
16 #if !defined(WIN32) && !defined(MS_WINDOWS)
17  #ifndef __stdcall
18  #define __stdcall
19  #endif
20  #ifndef __cdecl
21  #define __cdecl
22  #endif
23  #ifndef __fastcall
24  #define __fastcall
25  #endif
26 #endif
27 #ifndef DL_IMPORT
28  #define DL_IMPORT(t) t
29 #endif
30 #ifndef DL_EXPORT
31  #define DL_EXPORT(t) t
32 #endif
33 #define __PYX_COMMA ,
34 #ifndef HAVE_LONG_LONG
35  #if PY_VERSION_HEX >= 0x02070000
36  #define HAVE_LONG_LONG
37  #endif
38 #endif
39 #ifndef PY_LONG_LONG
40  #define PY_LONG_LONG LONG_LONG
41 #endif
42 #ifndef Py_HUGE_VAL
43  #define Py_HUGE_VAL HUGE_VAL
44 #endif
45 #ifdef PYPY_VERSION
46  #define CYTHON_COMPILING_IN_PYPY 1
47  #define CYTHON_COMPILING_IN_PYSTON 0
48  #define CYTHON_COMPILING_IN_CPYTHON 0
49  #undef CYTHON_USE_TYPE_SLOTS
50  #define CYTHON_USE_TYPE_SLOTS 0
51  #undef CYTHON_USE_PYTYPE_LOOKUP
52  #define CYTHON_USE_PYTYPE_LOOKUP 0
53  #if PY_VERSION_HEX < 0x03050000
54  #undef CYTHON_USE_ASYNC_SLOTS
55  #define CYTHON_USE_ASYNC_SLOTS 0
56  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
57  #define CYTHON_USE_ASYNC_SLOTS 1
58  #endif
59  #undef CYTHON_USE_PYLIST_INTERNALS
60  #define CYTHON_USE_PYLIST_INTERNALS 0
61  #undef CYTHON_USE_UNICODE_INTERNALS
62  #define CYTHON_USE_UNICODE_INTERNALS 0
63  #undef CYTHON_USE_UNICODE_WRITER
64  #define CYTHON_USE_UNICODE_WRITER 0
65  #undef CYTHON_USE_PYLONG_INTERNALS
66  #define CYTHON_USE_PYLONG_INTERNALS 0
67  #undef CYTHON_AVOID_BORROWED_REFS
68  #define CYTHON_AVOID_BORROWED_REFS 1
69  #undef CYTHON_ASSUME_SAFE_MACROS
70  #define CYTHON_ASSUME_SAFE_MACROS 0
71  #undef CYTHON_UNPACK_METHODS
72  #define CYTHON_UNPACK_METHODS 0
73  #undef CYTHON_FAST_THREAD_STATE
74  #define CYTHON_FAST_THREAD_STATE 0
75  #undef CYTHON_FAST_PYCALL
76  #define CYTHON_FAST_PYCALL 0
77  #undef CYTHON_PEP489_MULTI_PHASE_INIT
78  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
79  #undef CYTHON_USE_TP_FINALIZE
80  #define CYTHON_USE_TP_FINALIZE 0
81 #elif defined(PYSTON_VERSION)
82  #define CYTHON_COMPILING_IN_PYPY 0
83  #define CYTHON_COMPILING_IN_PYSTON 1
84  #define CYTHON_COMPILING_IN_CPYTHON 0
85  #ifndef CYTHON_USE_TYPE_SLOTS
86  #define CYTHON_USE_TYPE_SLOTS 1
87  #endif
88  #undef CYTHON_USE_PYTYPE_LOOKUP
89  #define CYTHON_USE_PYTYPE_LOOKUP 0
90  #undef CYTHON_USE_ASYNC_SLOTS
91  #define CYTHON_USE_ASYNC_SLOTS 0
92  #undef CYTHON_USE_PYLIST_INTERNALS
93  #define CYTHON_USE_PYLIST_INTERNALS 0
94  #ifndef CYTHON_USE_UNICODE_INTERNALS
95  #define CYTHON_USE_UNICODE_INTERNALS 1
96  #endif
97  #undef CYTHON_USE_UNICODE_WRITER
98  #define CYTHON_USE_UNICODE_WRITER 0
99  #undef CYTHON_USE_PYLONG_INTERNALS
100  #define CYTHON_USE_PYLONG_INTERNALS 0
101  #ifndef CYTHON_AVOID_BORROWED_REFS
102  #define CYTHON_AVOID_BORROWED_REFS 0
103  #endif
104  #ifndef CYTHON_ASSUME_SAFE_MACROS
105  #define CYTHON_ASSUME_SAFE_MACROS 1
106  #endif
107  #ifndef CYTHON_UNPACK_METHODS
108  #define CYTHON_UNPACK_METHODS 1
109  #endif
110  #undef CYTHON_FAST_THREAD_STATE
111  #define CYTHON_FAST_THREAD_STATE 0
112  #undef CYTHON_FAST_PYCALL
113  #define CYTHON_FAST_PYCALL 0
114  #undef CYTHON_PEP489_MULTI_PHASE_INIT
115  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
116  #undef CYTHON_USE_TP_FINALIZE
117  #define CYTHON_USE_TP_FINALIZE 0
118 #else
119  #define CYTHON_COMPILING_IN_PYPY 0
120  #define CYTHON_COMPILING_IN_PYSTON 0
121  #define CYTHON_COMPILING_IN_CPYTHON 1
122  #ifndef CYTHON_USE_TYPE_SLOTS
123  #define CYTHON_USE_TYPE_SLOTS 1
124  #endif
125  #if PY_VERSION_HEX < 0x02070000
126  #undef CYTHON_USE_PYTYPE_LOOKUP
127  #define CYTHON_USE_PYTYPE_LOOKUP 0
128  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
129  #define CYTHON_USE_PYTYPE_LOOKUP 1
130  #endif
131  #if PY_MAJOR_VERSION < 3
132  #undef CYTHON_USE_ASYNC_SLOTS
133  #define CYTHON_USE_ASYNC_SLOTS 0
134  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
135  #define CYTHON_USE_ASYNC_SLOTS 1
136  #endif
137  #if PY_VERSION_HEX < 0x02070000
138  #undef CYTHON_USE_PYLONG_INTERNALS
139  #define CYTHON_USE_PYLONG_INTERNALS 0
140  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
141  #define CYTHON_USE_PYLONG_INTERNALS 1
142  #endif
143  #ifndef CYTHON_USE_PYLIST_INTERNALS
144  #define CYTHON_USE_PYLIST_INTERNALS 1
145  #endif
146  #ifndef CYTHON_USE_UNICODE_INTERNALS
147  #define CYTHON_USE_UNICODE_INTERNALS 1
148  #endif
149  #if PY_VERSION_HEX < 0x030300F0
150  #undef CYTHON_USE_UNICODE_WRITER
151  #define CYTHON_USE_UNICODE_WRITER 0
152  #elif !defined(CYTHON_USE_UNICODE_WRITER)
153  #define CYTHON_USE_UNICODE_WRITER 1
154  #endif
155  #ifndef CYTHON_AVOID_BORROWED_REFS
156  #define CYTHON_AVOID_BORROWED_REFS 0
157  #endif
158  #ifndef CYTHON_ASSUME_SAFE_MACROS
159  #define CYTHON_ASSUME_SAFE_MACROS 1
160  #endif
161  #ifndef CYTHON_UNPACK_METHODS
162  #define CYTHON_UNPACK_METHODS 1
163  #endif
164  #ifndef CYTHON_FAST_THREAD_STATE
165  #define CYTHON_FAST_THREAD_STATE 1
166  #endif
167  #ifndef CYTHON_FAST_PYCALL
168  #define CYTHON_FAST_PYCALL 1
169  #endif
170  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
171  #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
172  #endif
173  #ifndef CYTHON_USE_TP_FINALIZE
174  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
175  #endif
176 #endif
177 #if !defined(CYTHON_FAST_PYCCALL)
178 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
179 #endif
180 #if CYTHON_USE_PYLONG_INTERNALS
181  #include "longintrepr.h"
182  #undef SHIFT
183  #undef BASE
184  #undef MASK
185 #endif
186 #ifndef __has_attribute
187  #define __has_attribute(x) 0
188 #endif
189 #ifndef __has_cpp_attribute
190  #define __has_cpp_attribute(x) 0
191 #endif
192 #ifndef CYTHON_RESTRICT
193  #if defined(__GNUC__)
194  #define CYTHON_RESTRICT __restrict__
195  #elif defined(_MSC_VER) && _MSC_VER >= 1400
196  #define CYTHON_RESTRICT __restrict
197  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
198  #define CYTHON_RESTRICT restrict
199  #else
200  #define CYTHON_RESTRICT
201  #endif
202 #endif
203 #ifndef CYTHON_UNUSED
204 # if defined(__GNUC__)
205 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
206 # define CYTHON_UNUSED __attribute__ ((__unused__))
207 # else
208 # define CYTHON_UNUSED
209 # endif
210 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
211 # define CYTHON_UNUSED __attribute__ ((__unused__))
212 # else
213 # define CYTHON_UNUSED
214 # endif
215 #endif
216 #ifndef CYTHON_MAYBE_UNUSED_VAR
217 # if defined(__cplusplus)
218  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
219 # else
220 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
221 # endif
222 #endif
223 #ifndef CYTHON_NCP_UNUSED
224 # if CYTHON_COMPILING_IN_CPYTHON
225 # define CYTHON_NCP_UNUSED
226 # else
227 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
228 # endif
229 #endif
230 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
231 #ifdef _MSC_VER
232  #ifndef _MSC_STDINT_H_
233  #if _MSC_VER < 1300
234  typedef unsigned char uint8_t;
235  typedef unsigned int uint32_t;
236  #else
237  typedef unsigned __int8 uint8_t;
238  typedef unsigned __int32 uint32_t;
239  #endif
240  #endif
241 #else
242  #include <stdint.h>
243 #endif
244 #ifndef CYTHON_FALLTHROUGH
245  #if defined(__cplusplus) && __cplusplus >= 201103L
246  #if __has_cpp_attribute(fallthrough)
247  #define CYTHON_FALLTHROUGH [[fallthrough]]
248  #elif __has_cpp_attribute(clang::fallthrough)
249  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
250  #elif __has_cpp_attribute(gnu::fallthrough)
251  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
252  #endif
253  #endif
254  #ifndef CYTHON_FALLTHROUGH
255  #if __has_attribute(fallthrough)
256  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
257  #else
258  #define CYTHON_FALLTHROUGH
259  #endif
260  #endif
261  #if defined(__clang__ ) && defined(__apple_build_version__)
262  #if __apple_build_version__ < 7000000
263  #undef CYTHON_FALLTHROUGH
264  #define CYTHON_FALLTHROUGH
265  #endif
266  #endif
267 #endif
268 
269 #ifndef CYTHON_INLINE
270  #if defined(__clang__)
271  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
272  #elif defined(__GNUC__)
273  #define CYTHON_INLINE __inline__
274  #elif defined(_MSC_VER)
275  #define CYTHON_INLINE __inline
276  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
277  #define CYTHON_INLINE inline
278  #else
279  #define CYTHON_INLINE
280  #endif
281 #endif
282 
283 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
284  #define Py_OptimizeFlag 0
285 #endif
286 #define __PYX_BUILD_PY_SSIZE_T "n"
287 #define CYTHON_FORMAT_SSIZE_T "z"
288 #if PY_MAJOR_VERSION < 3
289  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
290  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
291  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
292  #define __Pyx_DefaultClassType PyClass_Type
293 #else
294  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
295  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
296  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
297  #define __Pyx_DefaultClassType PyType_Type
298 #endif
299 #ifndef Py_TPFLAGS_CHECKTYPES
300  #define Py_TPFLAGS_CHECKTYPES 0
301 #endif
302 #ifndef Py_TPFLAGS_HAVE_INDEX
303  #define Py_TPFLAGS_HAVE_INDEX 0
304 #endif
305 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
306  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
307 #endif
308 #ifndef Py_TPFLAGS_HAVE_FINALIZE
309  #define Py_TPFLAGS_HAVE_FINALIZE 0
310 #endif
311 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
312  #ifndef METH_FASTCALL
313  #define METH_FASTCALL 0x80
314  #endif
315  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
316  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
317  Py_ssize_t nargs, PyObject *kwnames);
318 #else
319  #define __Pyx_PyCFunctionFast _PyCFunctionFast
320  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
321 #endif
322 #if CYTHON_FAST_PYCCALL
323 #define __Pyx_PyFastCFunction_Check(func)\
324  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
325 #else
326 #define __Pyx_PyFastCFunction_Check(func) 0
327 #endif
328 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
329  #define PyObject_Malloc(s) PyMem_Malloc(s)
330  #define PyObject_Free(p) PyMem_Free(p)
331  #define PyObject_Realloc(p) PyMem_Realloc(p)
332 #endif
333 #if CYTHON_COMPILING_IN_PYSTON
334  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
335  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
336 #else
337  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
338  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
339 #endif
340 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
341  #define __Pyx_PyThreadState_Current PyThreadState_GET()
342 #elif PY_VERSION_HEX >= 0x03060000
343  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
344 #elif PY_VERSION_HEX >= 0x03000000
345  #define __Pyx_PyThreadState_Current PyThreadState_GET()
346 #else
347  #define __Pyx_PyThreadState_Current _PyThreadState_Current
348 #endif
349 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
350 #include "pythread.h"
351 #define Py_tss_NEEDS_INIT 0
352 typedef int Py_tss_t;
353 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
354  *key = PyThread_create_key();
355  return 0; // PyThread_create_key reports success always
356 }
357 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
358  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
359  *key = Py_tss_NEEDS_INIT;
360  return key;
361 }
362 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
363  PyObject_Free(key);
364 }
365 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
366  return *key != Py_tss_NEEDS_INIT;
367 }
368 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
369  PyThread_delete_key(*key);
370  *key = Py_tss_NEEDS_INIT;
371 }
372 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
373  return PyThread_set_key_value(*key, value);
374 }
375 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
376  return PyThread_get_key_value(*key);
377 }
378 #endif // TSS (Thread Specific Storage) API
379 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
380 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
381 #else
382 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
383 #endif
384 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
385  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
386  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
387 #else
388  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
389  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
390 #endif
391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
392 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
393 #else
394 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
395 #endif
396 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
397  #define CYTHON_PEP393_ENABLED 1
398  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
399  0 : _PyUnicode_Ready((PyObject *)(op)))
400  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
401  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
402  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
403  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
404  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
405  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
406  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
407  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
408 #else
409  #define CYTHON_PEP393_ENABLED 0
410  #define PyUnicode_1BYTE_KIND 1
411  #define PyUnicode_2BYTE_KIND 2
412  #define PyUnicode_4BYTE_KIND 4
413  #define __Pyx_PyUnicode_READY(op) (0)
414  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
415  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
416  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
417  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
418  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
419  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
420  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
421  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
422 #endif
423 #if CYTHON_COMPILING_IN_PYPY
424  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
425  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
426 #else
427  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
428  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
429  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
430 #endif
431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
432  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
433 #endif
434 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
435  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
436 #endif
437 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
438  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
439 #endif
440 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
441 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
442 #if PY_MAJOR_VERSION >= 3
443  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
444 #else
445  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
446 #endif
447 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
448  #define PyObject_ASCII(o) PyObject_Repr(o)
449 #endif
450 #if PY_MAJOR_VERSION >= 3
451  #define PyBaseString_Type PyUnicode_Type
452  #define PyStringObject PyUnicodeObject
453  #define PyString_Type PyUnicode_Type
454  #define PyString_Check PyUnicode_Check
455  #define PyString_CheckExact PyUnicode_CheckExact
456  #define PyObject_Unicode PyObject_Str
457 #endif
458 #if PY_MAJOR_VERSION >= 3
459  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
460  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
461 #else
462  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
463  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
464 #endif
465 #ifndef PySet_CheckExact
466  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
467 #endif
468 #if CYTHON_ASSUME_SAFE_MACROS
469  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
470 #else
471  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
472 #endif
473 #if PY_MAJOR_VERSION >= 3
474  #define PyIntObject PyLongObject
475  #define PyInt_Type PyLong_Type
476  #define PyInt_Check(op) PyLong_Check(op)
477  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
478  #define PyInt_FromString PyLong_FromString
479  #define PyInt_FromUnicode PyLong_FromUnicode
480  #define PyInt_FromLong PyLong_FromLong
481  #define PyInt_FromSize_t PyLong_FromSize_t
482  #define PyInt_FromSsize_t PyLong_FromSsize_t
483  #define PyInt_AsLong PyLong_AsLong
484  #define PyInt_AS_LONG PyLong_AS_LONG
485  #define PyInt_AsSsize_t PyLong_AsSsize_t
486  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
487  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
488  #define PyNumber_Int PyNumber_Long
489 #endif
490 #if PY_MAJOR_VERSION >= 3
491  #define PyBoolObject PyLongObject
492 #endif
493 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
494  #ifndef PyUnicode_InternFromString
495  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
496  #endif
497 #endif
498 #if PY_VERSION_HEX < 0x030200A4
499  typedef long Py_hash_t;
500  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
501  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
502 #else
503  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
504  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
505 #endif
506 #if PY_MAJOR_VERSION >= 3
507  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
508 #else
509  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
510 #endif
511 #if CYTHON_USE_ASYNC_SLOTS
512  #if PY_VERSION_HEX >= 0x030500B1
513  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
514  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
515  #else
516  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
517  #endif
518 #else
519  #define __Pyx_PyType_AsAsync(obj) NULL
520 #endif
521 #ifndef __Pyx_PyAsyncMethodsStruct
522  typedef struct {
523  unaryfunc am_await;
524  unaryfunc am_aiter;
525  unaryfunc am_anext;
526  } __Pyx_PyAsyncMethodsStruct;
527 #endif
528 
529 #if defined(WIN32) || defined(MS_WINDOWS)
530  #define _USE_MATH_DEFINES
531 #endif
532 #include <math.h>
533 #ifdef NAN
534 #define __PYX_NAN() ((float) NAN)
535 #else
536 static CYTHON_INLINE float __PYX_NAN() {
537  float value;
538  memset(&value, 0xFF, sizeof(value));
539  return value;
540 }
541 #endif
542 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
543 #define __Pyx_truncl trunc
544 #else
545 #define __Pyx_truncl truncl
546 #endif
547 
548 
549 #define __PYX_ERR(f_index, lineno, Ln_error) \
550 { \
551  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
552 }
553 
554 #ifndef __PYX_EXTERN_C
555  #ifdef __cplusplus
556  #define __PYX_EXTERN_C extern "C"
557  #else
558  #define __PYX_EXTERN_C extern
559  #endif
560 #endif
561 
562 #define __PYX_HAVE__superluWrappers
563 #define __PYX_HAVE_API__superluWrappers
564 /* Early includes */
565 #include <string.h>
566 #include <stdio.h>
567 #include "numpy/arrayobject.h"
568 #include "numpy/ufuncobject.h"
569 #include "proteus_superlu.h"
570 #include <stdlib.h>
571 #include "pythread.h"
572 #include "pystate.h"
573 #ifdef _OPENMP
574 #include <omp.h>
575 #endif /* _OPENMP */
576 
577 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
578 #define CYTHON_WITHOUT_ASSERTIONS
579 #endif
580 
581 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
582  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
583 
584 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
585 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
586 #define __PYX_DEFAULT_STRING_ENCODING ""
587 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
588 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
589 #define __Pyx_uchar_cast(c) ((unsigned char)c)
590 #define __Pyx_long_cast(x) ((long)x)
591 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
592  (sizeof(type) < sizeof(Py_ssize_t)) ||\
593  (sizeof(type) > sizeof(Py_ssize_t) &&\
594  likely(v < (type)PY_SSIZE_T_MAX ||\
595  v == (type)PY_SSIZE_T_MAX) &&\
596  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
597  v == (type)PY_SSIZE_T_MIN))) ||\
598  (sizeof(type) == sizeof(Py_ssize_t) &&\
599  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
600  v == (type)PY_SSIZE_T_MAX))) )
601 #if defined (__cplusplus) && __cplusplus >= 201103L
602  #include <cstdlib>
603  #define __Pyx_sst_abs(value) std::abs(value)
604 #elif SIZEOF_INT >= SIZEOF_SIZE_T
605  #define __Pyx_sst_abs(value) abs(value)
606 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
607  #define __Pyx_sst_abs(value) labs(value)
608 #elif defined (_MSC_VER)
609  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
610 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
611  #define __Pyx_sst_abs(value) llabs(value)
612 #elif defined (__GNUC__)
613  #define __Pyx_sst_abs(value) __builtin_llabs(value)
614 #else
615  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
616 #endif
617 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
618 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
619 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
620 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
621 #define __Pyx_PyBytes_FromString PyBytes_FromString
622 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
623 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
624 #if PY_MAJOR_VERSION < 3
625  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
626  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
627 #else
628  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
629  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
630 #endif
631 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
636 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
637 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
640 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
641 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
642 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
643 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
644 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
645 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
646 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
647 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
648  const Py_UNICODE *u_end = u;
649  while (*u_end++) ;
650  return (size_t)(u_end - u - 1);
651 }
652 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
653 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
654 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
655 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
656 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
657 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
658 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
659 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
660 #define __Pyx_PySequence_Tuple(obj)\
661  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
662 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
663 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
664 #if CYTHON_ASSUME_SAFE_MACROS
665 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
666 #else
667 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
668 #endif
669 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
670 #if PY_MAJOR_VERSION >= 3
671 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
672 #else
673 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
674 #endif
675 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
676 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
677 static int __Pyx_sys_getdefaultencoding_not_ascii;
678 static int __Pyx_init_sys_getdefaultencoding_params(void) {
679  PyObject* sys;
680  PyObject* default_encoding = NULL;
681  PyObject* ascii_chars_u = NULL;
682  PyObject* ascii_chars_b = NULL;
683  const char* default_encoding_c;
684  sys = PyImport_ImportModule("sys");
685  if (!sys) goto bad;
686  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
687  Py_DECREF(sys);
688  if (!default_encoding) goto bad;
689  default_encoding_c = PyBytes_AsString(default_encoding);
690  if (!default_encoding_c) goto bad;
691  if (strcmp(default_encoding_c, "ascii") == 0) {
692  __Pyx_sys_getdefaultencoding_not_ascii = 0;
693  } else {
694  char ascii_chars[128];
695  int c;
696  for (c = 0; c < 128; c++) {
697  ascii_chars[c] = c;
698  }
699  __Pyx_sys_getdefaultencoding_not_ascii = 1;
700  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
701  if (!ascii_chars_u) goto bad;
702  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
703  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
704  PyErr_Format(
705  PyExc_ValueError,
706  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
707  default_encoding_c);
708  goto bad;
709  }
710  Py_DECREF(ascii_chars_u);
711  Py_DECREF(ascii_chars_b);
712  }
713  Py_DECREF(default_encoding);
714  return 0;
715 bad:
716  Py_XDECREF(default_encoding);
717  Py_XDECREF(ascii_chars_u);
718  Py_XDECREF(ascii_chars_b);
719  return -1;
720 }
721 #endif
722 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
723 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
724 #else
725 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
726 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
727 static char* __PYX_DEFAULT_STRING_ENCODING;
728 static int __Pyx_init_sys_getdefaultencoding_params(void) {
729  PyObject* sys;
730  PyObject* default_encoding = NULL;
731  char* default_encoding_c;
732  sys = PyImport_ImportModule("sys");
733  if (!sys) goto bad;
734  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
735  Py_DECREF(sys);
736  if (!default_encoding) goto bad;
737  default_encoding_c = PyBytes_AsString(default_encoding);
738  if (!default_encoding_c) goto bad;
739  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
740  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
741  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
742  Py_DECREF(default_encoding);
743  return 0;
744 bad:
745  Py_XDECREF(default_encoding);
746  return -1;
747 }
748 #endif
749 #endif
750 
751 
752 /* Test for GCC > 2.95 */
753 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
754  #define likely(x) __builtin_expect(!!(x), 1)
755  #define unlikely(x) __builtin_expect(!!(x), 0)
756 #else /* !__GNUC__ or GCC < 2.95 */
757  #define likely(x) (x)
758  #define unlikely(x) (x)
759 #endif /* __GNUC__ */
760 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
761 
762 static PyObject *__pyx_m = NULL;
763 static PyObject *__pyx_d;
764 static PyObject *__pyx_b;
765 static PyObject *__pyx_cython_runtime = NULL;
766 static PyObject *__pyx_empty_tuple;
767 static PyObject *__pyx_empty_bytes;
768 static PyObject *__pyx_empty_unicode;
769 static int __pyx_lineno;
770 static int __pyx_clineno = 0;
771 static const char * __pyx_cfilenm= __FILE__;
772 static const char *__pyx_filename;
773 
774 /* Header.proto */
775 #if !defined(CYTHON_CCOMPLEX)
776  #if defined(__cplusplus)
777  #define CYTHON_CCOMPLEX 1
778  #elif defined(_Complex_I)
779  #define CYTHON_CCOMPLEX 1
780  #else
781  #define CYTHON_CCOMPLEX 0
782  #endif
783 #endif
784 #if CYTHON_CCOMPLEX
785  #ifdef __cplusplus
786  #include <complex>
787  #else
788  #include <complex.h>
789  #endif
790 #endif
791 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
792  #undef _Complex_I
793  #define _Complex_I 1.0fj
794 #endif
795 
796 
797 static const char *__pyx_f[] = {
798  "proteus/superluWrappers.pyx",
799  "stringsource",
800  "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
801  "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
802 };
803 /* MemviewSliceStruct.proto */
804 struct __pyx_memoryview_obj;
805 typedef struct {
806  struct __pyx_memoryview_obj *memview;
807  char *data;
808  Py_ssize_t shape[8];
809  Py_ssize_t strides[8];
810  Py_ssize_t suboffsets[8];
811 } __Pyx_memviewslice;
812 #define __Pyx_MemoryView_Len(m) (m.shape[0])
813 
814 /* Atomics.proto */
815 #include <pythread.h>
816 #ifndef CYTHON_ATOMICS
817  #define CYTHON_ATOMICS 1
818 #endif
819 #define __pyx_atomic_int_type int
820 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
821  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
822  !defined(__i386__)
823  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
824  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
825  #ifdef __PYX_DEBUG_ATOMICS
826  #warning "Using GNU atomics"
827  #endif
828 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
829  #include <Windows.h>
830  #undef __pyx_atomic_int_type
831  #define __pyx_atomic_int_type LONG
832  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
833  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
834  #ifdef __PYX_DEBUG_ATOMICS
835  #pragma message ("Using MSVC atomics")
836  #endif
837 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
838  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
839  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
840  #ifdef __PYX_DEBUG_ATOMICS
841  #warning "Using Intel atomics"
842  #endif
843 #else
844  #undef CYTHON_ATOMICS
845  #define CYTHON_ATOMICS 0
846  #ifdef __PYX_DEBUG_ATOMICS
847  #warning "Not using atomics"
848  #endif
849 #endif
850 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
851 #if CYTHON_ATOMICS
852  #define __pyx_add_acquisition_count(memview)\
853  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
854  #define __pyx_sub_acquisition_count(memview)\
855  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
856 #else
857  #define __pyx_add_acquisition_count(memview)\
858  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
859  #define __pyx_sub_acquisition_count(memview)\
860  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
861 #endif
862 
863 /* ForceInitThreads.proto */
864 #ifndef __PYX_FORCE_INIT_THREADS
865  #define __PYX_FORCE_INIT_THREADS 0
866 #endif
867 
868 /* NoFastGil.proto */
869 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
870 #define __Pyx_PyGILState_Release PyGILState_Release
871 #define __Pyx_FastGIL_Remember()
872 #define __Pyx_FastGIL_Forget()
873 #define __Pyx_FastGilFuncInit()
874 
875 /* BufferFormatStructs.proto */
876 #define IS_UNSIGNED(type) (((type) -1) > 0)
877 struct __Pyx_StructField_;
878 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
879 typedef struct {
880  const char* name;
881  struct __Pyx_StructField_* fields;
882  size_t size;
883  size_t arraysize[8];
884  int ndim;
885  char typegroup;
886  char is_unsigned;
887  int flags;
888 } __Pyx_TypeInfo;
889 typedef struct __Pyx_StructField_ {
890  __Pyx_TypeInfo* type;
891  const char* name;
892  size_t offset;
893 } __Pyx_StructField;
894 typedef struct {
895  __Pyx_StructField* field;
896  size_t parent_offset;
897 } __Pyx_BufFmt_StackElem;
898 typedef struct {
899  __Pyx_StructField root;
900  __Pyx_BufFmt_StackElem* head;
901  size_t fmt_offset;
902  size_t new_count, enc_count;
903  size_t struct_alignment;
904  int is_complex;
905  char enc_type;
906  char new_packmode;
907  char enc_packmode;
908  char is_valid_array;
909 } __Pyx_BufFmt_Context;
910 
911 
912 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
913  * # in Cython to enable them only on the right systems.
914  *
915  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
916  * ctypedef npy_int16 int16_t
917  * ctypedef npy_int32 int32_t
918  */
919 typedef npy_int8 __pyx_t_5numpy_int8_t;
920 
921 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
922  *
923  * ctypedef npy_int8 int8_t
924  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
925  * ctypedef npy_int32 int32_t
926  * ctypedef npy_int64 int64_t
927  */
928 typedef npy_int16 __pyx_t_5numpy_int16_t;
929 
930 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
931  * ctypedef npy_int8 int8_t
932  * ctypedef npy_int16 int16_t
933  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
934  * ctypedef npy_int64 int64_t
935  * #ctypedef npy_int96 int96_t
936  */
937 typedef npy_int32 __pyx_t_5numpy_int32_t;
938 
939 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
940  * ctypedef npy_int16 int16_t
941  * ctypedef npy_int32 int32_t
942  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
943  * #ctypedef npy_int96 int96_t
944  * #ctypedef npy_int128 int128_t
945  */
946 typedef npy_int64 __pyx_t_5numpy_int64_t;
947 
948 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
949  * #ctypedef npy_int128 int128_t
950  *
951  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
952  * ctypedef npy_uint16 uint16_t
953  * ctypedef npy_uint32 uint32_t
954  */
955 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
956 
957 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
958  *
959  * ctypedef npy_uint8 uint8_t
960  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
961  * ctypedef npy_uint32 uint32_t
962  * ctypedef npy_uint64 uint64_t
963  */
964 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
965 
966 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739
967  * ctypedef npy_uint8 uint8_t
968  * ctypedef npy_uint16 uint16_t
969  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
970  * ctypedef npy_uint64 uint64_t
971  * #ctypedef npy_uint96 uint96_t
972  */
973 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
974 
975 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740
976  * ctypedef npy_uint16 uint16_t
977  * ctypedef npy_uint32 uint32_t
978  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
979  * #ctypedef npy_uint96 uint96_t
980  * #ctypedef npy_uint128 uint128_t
981  */
982 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
983 
984 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":744
985  * #ctypedef npy_uint128 uint128_t
986  *
987  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
988  * ctypedef npy_float64 float64_t
989  * #ctypedef npy_float80 float80_t
990  */
991 typedef npy_float32 __pyx_t_5numpy_float32_t;
992 
993 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":745
994  *
995  * ctypedef npy_float32 float32_t
996  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
997  * #ctypedef npy_float80 float80_t
998  * #ctypedef npy_float128 float128_t
999  */
1000 typedef npy_float64 __pyx_t_5numpy_float64_t;
1001 
1002 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754
1003  * # The int types are mapped a bit surprising --
1004  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1005  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1006  * ctypedef npy_longlong long_t
1007  * ctypedef npy_longlong longlong_t
1008  */
1009 typedef npy_long __pyx_t_5numpy_int_t;
1010 
1011 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
1012  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1013  * ctypedef npy_long int_t
1014  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1015  * ctypedef npy_longlong longlong_t
1016  *
1017  */
1018 typedef npy_longlong __pyx_t_5numpy_long_t;
1019 
1020 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
1021  * ctypedef npy_long int_t
1022  * ctypedef npy_longlong long_t
1023  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1024  *
1025  * ctypedef npy_ulong uint_t
1026  */
1027 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1028 
1029 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
1030  * ctypedef npy_longlong longlong_t
1031  *
1032  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1033  * ctypedef npy_ulonglong ulong_t
1034  * ctypedef npy_ulonglong ulonglong_t
1035  */
1036 typedef npy_ulong __pyx_t_5numpy_uint_t;
1037 
1038 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
1039  *
1040  * ctypedef npy_ulong uint_t
1041  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1042  * ctypedef npy_ulonglong ulonglong_t
1043  *
1044  */
1045 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1046 
1047 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
1048  * ctypedef npy_ulong uint_t
1049  * ctypedef npy_ulonglong ulong_t
1050  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1051  *
1052  * ctypedef npy_intp intp_t
1053  */
1054 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1055 
1056 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
1057  * ctypedef npy_ulonglong ulonglong_t
1058  *
1059  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1060  * ctypedef npy_uintp uintp_t
1061  *
1062  */
1063 typedef npy_intp __pyx_t_5numpy_intp_t;
1064 
1065 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
1066  *
1067  * ctypedef npy_intp intp_t
1068  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1069  *
1070  * ctypedef npy_double float_t
1071  */
1072 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1073 
1074 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765
1075  * ctypedef npy_uintp uintp_t
1076  *
1077  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1078  * ctypedef npy_double double_t
1079  * ctypedef npy_longdouble longdouble_t
1080  */
1081 typedef npy_double __pyx_t_5numpy_float_t;
1082 
1083 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
1084  *
1085  * ctypedef npy_double float_t
1086  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1087  * ctypedef npy_longdouble longdouble_t
1088  *
1089  */
1090 typedef npy_double __pyx_t_5numpy_double_t;
1091 
1092 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767
1093  * ctypedef npy_double float_t
1094  * ctypedef npy_double double_t
1095  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1096  *
1097  * ctypedef npy_cfloat cfloat_t
1098  */
1099 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1100 /* Declarations.proto */
1101 #if CYTHON_CCOMPLEX
1102  #ifdef __cplusplus
1103  typedef ::std::complex< float > __pyx_t_float_complex;
1104  #else
1105  typedef float _Complex __pyx_t_float_complex;
1106  #endif
1107 #else
1108  typedef struct { float real, imag; } __pyx_t_float_complex;
1109 #endif
1110 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1111 
1112 /* Declarations.proto */
1113 #if CYTHON_CCOMPLEX
1114  #ifdef __cplusplus
1115  typedef ::std::complex< double > __pyx_t_double_complex;
1116  #else
1117  typedef double _Complex __pyx_t_double_complex;
1118  #endif
1119 #else
1120  typedef struct { double real, imag; } __pyx_t_double_complex;
1121 #endif
1122 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1123 
1124 
1125 /*--- Type declarations ---*/
1126 struct __pyx_obj_15superluWrappers_cSparseMatrix;
1127 struct __pyx_obj_15superluWrappers_SparseFactor;
1128 struct __pyx_array_obj;
1129 struct __pyx_MemviewEnum_obj;
1130 struct __pyx_memoryview_obj;
1131 struct __pyx_memoryviewslice_obj;
1132 
1133 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
1134  * ctypedef npy_longdouble longdouble_t
1135  *
1136  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1137  * ctypedef npy_cdouble cdouble_t
1138  * ctypedef npy_clongdouble clongdouble_t
1139  */
1140 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1141 
1142 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
1143  *
1144  * ctypedef npy_cfloat cfloat_t
1145  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1146  * ctypedef npy_clongdouble clongdouble_t
1147  *
1148  */
1149 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1150 
1151 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
1152  * ctypedef npy_cfloat cfloat_t
1153  * ctypedef npy_cdouble cdouble_t
1154  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1155  *
1156  * ctypedef npy_cdouble complex_t
1157  */
1158 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1159 
1160 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
1161  * ctypedef npy_clongdouble clongdouble_t
1162  *
1163  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1164  *
1165  * cdef inline object PyArray_MultiIterNew1(a):
1166  */
1167 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1168 struct __pyx_t_15superluWrappers__NRformat;
1169 struct __pyx_t_15superluWrappers__NCformat;
1170 struct __pyx_t_15superluWrappers__DNformat;
1171 struct __pyx_t_15superluWrappers__NCPformat;
1172 
1173 /* "superluWrappers.pxd":61
1174  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1175  *
1176  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1177  * np.int32_t nnz
1178  * np.float64_t * nzval
1179  */
1180 struct __pyx_t_15superluWrappers__NRformat {
1181  __pyx_t_5numpy_int32_t nnz;
1182  __pyx_t_5numpy_float64_t *nzval;
1183  __pyx_t_5numpy_int32_t *colind;
1184  __pyx_t_5numpy_int32_t *rowptr;
1185 };
1186 
1187 /* "superluWrappers.pyx":128
1188  * yp[i] = tmp
1189  *
1190  * cdef struct _NCformat: # <<<<<<<<<<<<<<
1191  * np.int32_t nnz
1192  * np.float64_t * nzval
1193  */
1194 struct __pyx_t_15superluWrappers__NCformat {
1195  __pyx_t_5numpy_int32_t nnz;
1196  __pyx_t_5numpy_float64_t *nzval;
1197  __pyx_t_5numpy_int32_t *rowind;
1198  __pyx_t_5numpy_int32_t *colptr;
1199 };
1200 
1201 /* "superluWrappers.pyx":134
1202  * np.int32_t * colptr
1203  *
1204  * cdef struct _DNformat: # <<<<<<<<<<<<<<
1205  * np.int32_t lda
1206  * void *nzval
1207  */
1208 struct __pyx_t_15superluWrappers__DNformat {
1209  __pyx_t_5numpy_int32_t lda;
1210  void *nzval;
1211 };
1212 
1213 /* "superluWrappers.pyx":138
1214  * void *nzval
1215  *
1216  * cdef struct _NCPformat: # <<<<<<<<<<<<<<
1217  * np.int32_t nnz
1218  * void * nzval
1219  */
1220 struct __pyx_t_15superluWrappers__NCPformat {
1221  __pyx_t_5numpy_int32_t nnz;
1222  void *nzval;
1223  __pyx_t_5numpy_int32_t *rowind;
1224  __pyx_t_5numpy_int32_t *colbeg;
1225  __pyx_t_5numpy_int32_t *colend;
1226 };
1227 
1228 /* "superluWrappers.pxd":67
1229  * np.int32_t * rowptr
1230  *
1231  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1232  * cdef np.int32_t dim[2]
1233  * cdef _NRformat A
1234  */
1235 struct __pyx_obj_15superluWrappers_cSparseMatrix {
1236  PyObject_HEAD
1237  __pyx_t_5numpy_int32_t dim[2];
1238  struct __pyx_t_15superluWrappers__NRformat A;
1239 };
1240 
1241 
1242 /* "superluWrappers.pyx":145
1243  * np.int32_t * colend
1244  *
1245  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1246  *
1247  * cdef _superlu_options_t options
1248  */
1249 struct __pyx_obj_15superluWrappers_SparseFactor {
1250  PyObject_HEAD
1251  struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtab;
1252  superlu_options_t options;
1253  SuperMatrix A;
1254  SuperMatrix AC;
1255  SuperMatrix L;
1256  SuperMatrix U;
1257  SuperMatrix X;
1258  GlobalLU_t Glu;
1259  SuperLUStat_t stat;
1260  struct __pyx_t_15superluWrappers__NCformat storeA;
1261  struct __pyx_t_15superluWrappers__DNformat storeX;
1262  int *perm_c;
1263  int *perm_r;
1264  int *etree;
1265  unsigned int use_same_perm_c;
1266  unsigned int use_same_sparsity;
1267  int dim;
1268 };
1269 
1270 
1271 /* "View.MemoryView":104
1272  *
1273  * @cname("__pyx_array")
1274  * cdef class array: # <<<<<<<<<<<<<<
1275  *
1276  * cdef:
1277  */
1278 struct __pyx_array_obj {
1279  PyObject_HEAD
1280  struct __pyx_vtabstruct_array *__pyx_vtab;
1281  char *data;
1282  Py_ssize_t len;
1283  char *format;
1284  int ndim;
1285  Py_ssize_t *_shape;
1286  Py_ssize_t *_strides;
1287  Py_ssize_t itemsize;
1288  PyObject *mode;
1289  PyObject *_format;
1290  void (*callback_free_data)(void *);
1291  int free_data;
1292  int dtype_is_object;
1293 };
1294 
1295 
1296 /* "View.MemoryView":278
1297  *
1298  * @cname('__pyx_MemviewEnum')
1299  * cdef class Enum(object): # <<<<<<<<<<<<<<
1300  * cdef object name
1301  * def __init__(self, name):
1302  */
1303 struct __pyx_MemviewEnum_obj {
1304  PyObject_HEAD
1305  PyObject *name;
1306 };
1307 
1308 
1309 /* "View.MemoryView":329
1310  *
1311  * @cname('__pyx_memoryview')
1312  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1313  *
1314  * cdef object obj
1315  */
1316 struct __pyx_memoryview_obj {
1317  PyObject_HEAD
1318  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1319  PyObject *obj;
1320  PyObject *_size;
1321  PyObject *_array_interface;
1322  PyThread_type_lock lock;
1323  __pyx_atomic_int acquisition_count[2];
1324  __pyx_atomic_int *acquisition_count_aligned_p;
1325  Py_buffer view;
1326  int flags;
1327  int dtype_is_object;
1328  __Pyx_TypeInfo *typeinfo;
1329 };
1330 
1331 
1332 /* "View.MemoryView":960
1333  *
1334  * @cname('__pyx_memoryviewslice')
1335  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1336  * "Internal class for passing memoryview slices to Python"
1337  *
1338  */
1339 struct __pyx_memoryviewslice_obj {
1340  struct __pyx_memoryview_obj __pyx_base;
1341  __Pyx_memviewslice from_slice;
1342  PyObject *from_object;
1343  PyObject *(*to_object_func)(char *);
1344  int (*to_dtype_func)(char *, PyObject *);
1345 };
1346 
1347 
1348 
1349 /* "superluWrappers.pyx":145
1350  * np.int32_t * colend
1351  *
1352  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1353  *
1354  * cdef _superlu_options_t options
1355  */
1356 
1357 struct __pyx_vtabstruct_15superluWrappers_SparseFactor {
1358  PyObject *(*_set_mat_types)(struct __pyx_obj_15superluWrappers_SparseFactor *);
1359 };
1360 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtabptr_15superluWrappers_SparseFactor;
1361 
1362 
1363 /* "View.MemoryView":104
1364  *
1365  * @cname("__pyx_array")
1366  * cdef class array: # <<<<<<<<<<<<<<
1367  *
1368  * cdef:
1369  */
1370 
1371 struct __pyx_vtabstruct_array {
1372  PyObject *(*get_memview)(struct __pyx_array_obj *);
1373 };
1374 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1375 
1376 
1377 /* "View.MemoryView":329
1378  *
1379  * @cname('__pyx_memoryview')
1380  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1381  *
1382  * cdef object obj
1383  */
1384 
1385 struct __pyx_vtabstruct_memoryview {
1386  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1387  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1388  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1389  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1390  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1391  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1392  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1393 };
1394 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1395 
1396 
1397 /* "View.MemoryView":960
1398  *
1399  * @cname('__pyx_memoryviewslice')
1400  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1401  * "Internal class for passing memoryview slices to Python"
1402  *
1403  */
1404 
1405 struct __pyx_vtabstruct__memoryviewslice {
1406  struct __pyx_vtabstruct_memoryview __pyx_base;
1407 };
1408 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1409 
1410 /* --- Runtime support code (head) --- */
1411 /* Refnanny.proto */
1412 #ifndef CYTHON_REFNANNY
1413  #define CYTHON_REFNANNY 0
1414 #endif
1415 #if CYTHON_REFNANNY
1416  typedef struct {
1417  void (*INCREF)(void*, PyObject*, int);
1418  void (*DECREF)(void*, PyObject*, int);
1419  void (*GOTREF)(void*, PyObject*, int);
1420  void (*GIVEREF)(void*, PyObject*, int);
1421  void* (*SetupContext)(const char*, int, const char*);
1422  void (*FinishContext)(void**);
1423  } __Pyx_RefNannyAPIStruct;
1424  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1425  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1426  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1427 #ifdef WITH_THREAD
1428  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1429  if (acquire_gil) {\
1430  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1431  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1432  PyGILState_Release(__pyx_gilstate_save);\
1433  } else {\
1434  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1435  }
1436 #else
1437  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1438  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1439 #endif
1440  #define __Pyx_RefNannyFinishContext()\
1441  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1442  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1443  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1444  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1445  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1446  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1447  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1448  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1449  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1450 #else
1451  #define __Pyx_RefNannyDeclarations
1452  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1453  #define __Pyx_RefNannyFinishContext()
1454  #define __Pyx_INCREF(r) Py_INCREF(r)
1455  #define __Pyx_DECREF(r) Py_DECREF(r)
1456  #define __Pyx_GOTREF(r)
1457  #define __Pyx_GIVEREF(r)
1458  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1459  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1460  #define __Pyx_XGOTREF(r)
1461  #define __Pyx_XGIVEREF(r)
1462 #endif
1463 #define __Pyx_XDECREF_SET(r, v) do {\
1464  PyObject *tmp = (PyObject *) r;\
1465  r = v; __Pyx_XDECREF(tmp);\
1466  } while (0)
1467 #define __Pyx_DECREF_SET(r, v) do {\
1468  PyObject *tmp = (PyObject *) r;\
1469  r = v; __Pyx_DECREF(tmp);\
1470  } while (0)
1471 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1472 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1473 
1474 /* PyObjectGetAttrStr.proto */
1475 #if CYTHON_USE_TYPE_SLOTS
1476 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1477 #else
1478 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1479 #endif
1480 
1481 /* GetBuiltinName.proto */
1482 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1483 
1484 /* RaiseArgTupleInvalid.proto */
1485 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1486  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1487 
1488 /* RaiseDoubleKeywords.proto */
1489 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1490 
1491 /* ParseKeywords.proto */
1492 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1493  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1494  const char* function_name);
1495 
1496 /* PyObjectSetAttrStr.proto */
1497 #if CYTHON_USE_TYPE_SLOTS
1498 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1499 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1500 #else
1501 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1502 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1503 #endif
1504 
1505 /* PyObjectCall.proto */
1506 #if CYTHON_COMPILING_IN_CPYTHON
1507 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1508 #else
1509 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1510 #endif
1511 
1512 /* ExtTypeTest.proto */
1513 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1514 
1515 /* MemviewSliceInit.proto */
1516 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1517 #define __Pyx_MEMVIEW_DIRECT 1
1518 #define __Pyx_MEMVIEW_PTR 2
1519 #define __Pyx_MEMVIEW_FULL 4
1520 #define __Pyx_MEMVIEW_CONTIG 8
1521 #define __Pyx_MEMVIEW_STRIDED 16
1522 #define __Pyx_MEMVIEW_FOLLOW 32
1523 #define __Pyx_IS_C_CONTIG 1
1524 #define __Pyx_IS_F_CONTIG 2
1525 static int __Pyx_init_memviewslice(
1526  struct __pyx_memoryview_obj *memview,
1527  int ndim,
1528  __Pyx_memviewslice *memviewslice,
1529  int memview_is_new_reference);
1530 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1531  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1532 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1533  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1534 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1535 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1536 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1537 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1538 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1539 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1540 
1541 /* PyObjectLookupSpecial.proto */
1542 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1543 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
1544  PyObject *res;
1545  PyTypeObject *tp = Py_TYPE(obj);
1546 #if PY_MAJOR_VERSION < 3
1547  if (unlikely(PyInstance_Check(obj)))
1548  return __Pyx_PyObject_GetAttrStr(obj, attr_name);
1549 #endif
1550  res = _PyType_Lookup(tp, attr_name);
1551  if (likely(res)) {
1552  descrgetfunc f = Py_TYPE(res)->tp_descr_get;
1553  if (!f) {
1554  Py_INCREF(res);
1555  } else {
1556  res = f(res, obj, (PyObject *)tp);
1557  }
1558  } else {
1559  PyErr_SetObject(PyExc_AttributeError, attr_name);
1560  }
1561  return res;
1562 }
1563 #else
1564 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1565 #endif
1566 
1567 /* PyCFunctionFastCall.proto */
1568 #if CYTHON_FAST_PYCCALL
1569 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1570 #else
1571 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1572 #endif
1573 
1574 /* PyFunctionFastCall.proto */
1575 #if CYTHON_FAST_PYCALL
1576 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1577  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1578 #if 1 || PY_VERSION_HEX < 0x030600B1
1579 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
1580 #else
1581 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1582 #endif
1583 #endif
1584 
1585 /* PyObjectCallMethO.proto */
1586 #if CYTHON_COMPILING_IN_CPYTHON
1587 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1588 #endif
1589 
1590 /* PyObjectCallOneArg.proto */
1591 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1592 
1593 /* PyObjectCallNoArg.proto */
1594 #if CYTHON_COMPILING_IN_CPYTHON
1595 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1596 #else
1597 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1598 #endif
1599 
1600 /* GetItemInt.proto */
1601 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1602  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1603  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1604  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1605  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1606 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1607  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1608  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1609  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1610 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1611  int wraparound, int boundscheck);
1612 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1613  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1614  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1615  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1616 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1617  int wraparound, int boundscheck);
1618 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1619 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1620  int is_list, int wraparound, int boundscheck);
1621 
1622 /* ObjectGetItem.proto */
1623 #if CYTHON_USE_TYPE_SLOTS
1624 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1625 #else
1626 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1627 #endif
1628 
1629 /* PyIntBinop.proto */
1630 #if !CYTHON_COMPILING_IN_PYPY
1631 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
1632 #else
1633 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1634  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1635 #endif
1636 
1637 /* PyThreadStateGet.proto */
1638 #if CYTHON_FAST_THREAD_STATE
1639 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1640 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1641 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1642 #else
1643 #define __Pyx_PyThreadState_declare
1644 #define __Pyx_PyThreadState_assign
1645 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1646 #endif
1647 
1648 /* SaveResetException.proto */
1649 #if CYTHON_FAST_THREAD_STATE
1650 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1651 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1652 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1653 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1654 #else
1655 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1656 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1657 #endif
1658 
1659 /* GetException.proto */
1660 #if CYTHON_FAST_THREAD_STATE
1661 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1662 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1663 #else
1664 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1665 #endif
1666 
1667 /* PyErrFetchRestore.proto */
1668 #if CYTHON_FAST_THREAD_STATE
1669 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1670 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1671 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1672 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1673 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1674 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1675 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1676 #if CYTHON_COMPILING_IN_CPYTHON
1677 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1678 #else
1679 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1680 #endif
1681 #else
1682 #define __Pyx_PyErr_Clear() PyErr_Clear()
1683 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1684 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1685 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1686 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1687 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1688 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1689 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1690 #endif
1691 
1692 /* SliceObject.proto */
1693 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1694  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1695  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1696  int has_cstart, int has_cstop, int wraparound);
1697 
1698 /* RaiseException.proto */
1699 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1700 
1701 /* WriteUnraisableException.proto */
1702 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1703  int lineno, const char *filename,
1704  int full_traceback, int nogil);
1705 
1706 /* DictGetItem.proto */
1707 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1708 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1709 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1710  (likely(PyDict_CheckExact(obj)) ?\
1711  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1712 #else
1713 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1714 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1715 #endif
1716 
1717 /* RaiseTooManyValuesToUnpack.proto */
1718 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1719 
1720 /* RaiseNeedMoreValuesToUnpack.proto */
1721 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1722 
1723 /* RaiseNoneIterError.proto */
1724 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1725 
1726 /* PyErrExceptionMatches.proto */
1727 #if CYTHON_FAST_THREAD_STATE
1728 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1729 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1730 #else
1731 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1732 #endif
1733 
1734 /* ArgTypeTest.proto */
1735 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1736  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1737  __Pyx__ArgTypeTest(obj, type, name, exact))
1738 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1739 
1740 /* IncludeStringH.proto */
1741 #include <string.h>
1742 
1743 /* BytesEquals.proto */
1744 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1745 
1746 /* UnicodeEquals.proto */
1747 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1748 
1749 /* StrEquals.proto */
1750 #if PY_MAJOR_VERSION >= 3
1751 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1752 #else
1753 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1754 #endif
1755 
1756 /* None.proto */
1757 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1758 
1759 /* UnaryNegOverflows.proto */
1760 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1761  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1762 
1763 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1764 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1765 /* GetAttr.proto */
1766 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1767 
1768 /* decode_c_string_utf16.proto */
1769 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1770  int byteorder = 0;
1771  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1772 }
1773 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1774  int byteorder = -1;
1775  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1776 }
1777 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1778  int byteorder = 1;
1779  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1780 }
1781 
1782 /* decode_c_string.proto */
1783 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1784  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1785  const char* encoding, const char* errors,
1786  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1787 
1788 /* GetAttr3.proto */
1789 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1790 
1791 /* GetModuleGlobalName.proto */
1792 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1793 
1794 /* SwapException.proto */
1795 #if CYTHON_FAST_THREAD_STATE
1796 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1797 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1798 #else
1799 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1800 #endif
1801 
1802 /* Import.proto */
1803 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1804 
1805 /* FastTypeChecks.proto */
1806 #if CYTHON_COMPILING_IN_CPYTHON
1807 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1808 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1809 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1810 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1811 #else
1812 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1813 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1814 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1815 #endif
1816 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1817 
1818 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1819 /* ListCompAppend.proto */
1820 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1821 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1822  PyListObject* L = (PyListObject*) list;
1823  Py_ssize_t len = Py_SIZE(list);
1824  if (likely(L->allocated > len)) {
1825  Py_INCREF(x);
1826  PyList_SET_ITEM(list, len, x);
1827  Py_SIZE(list) = len+1;
1828  return 0;
1829  }
1830  return PyList_Append(list, x);
1831 }
1832 #else
1833 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1834 #endif
1835 
1836 /* ListExtend.proto */
1837 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1838 #if CYTHON_COMPILING_IN_CPYTHON
1839  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1840  if (unlikely(!none))
1841  return -1;
1842  Py_DECREF(none);
1843  return 0;
1844 #else
1845  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1846 #endif
1847 }
1848 
1849 /* ListAppend.proto */
1850 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1851 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1852  PyListObject* L = (PyListObject*) list;
1853  Py_ssize_t len = Py_SIZE(list);
1854  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1855  Py_INCREF(x);
1856  PyList_SET_ITEM(list, len, x);
1857  Py_SIZE(list) = len+1;
1858  return 0;
1859  }
1860  return PyList_Append(list, x);
1861 }
1862 #else
1863 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1864 #endif
1865 
1866 /* None.proto */
1867 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1868 
1869 /* None.proto */
1870 static CYTHON_INLINE long __Pyx_div_long(long, long);
1871 
1872 /* ImportFrom.proto */
1873 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1874 
1875 /* HasAttr.proto */
1876 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1877 
1878 /* PyObject_GenericGetAttrNoDict.proto */
1879 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1880 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1881 #else
1882 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1883 #endif
1884 
1885 /* PyObject_GenericGetAttr.proto */
1886 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1887 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1888 #else
1889 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1890 #endif
1891 
1892 /* SetupReduce.proto */
1893 static int __Pyx_setup_reduce(PyObject* type_obj);
1894 
1895 /* SetVTable.proto */
1896 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1897 
1898 /* CalculateMetaclass.proto */
1899 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1900 
1901 /* FetchCommonType.proto */
1902 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1903 
1904 /* CythonFunction.proto */
1905 #define __Pyx_CyFunction_USED 1
1906 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1907 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1908 #define __Pyx_CYFUNCTION_CCLASS 0x04
1909 #define __Pyx_CyFunction_GetClosure(f)\
1910  (((__pyx_CyFunctionObject *) (f))->func_closure)
1911 #define __Pyx_CyFunction_GetClassObj(f)\
1912  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1913 #define __Pyx_CyFunction_Defaults(type, f)\
1914  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1915 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1916  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1917 typedef struct {
1918  PyCFunctionObject func;
1919 #if PY_VERSION_HEX < 0x030500A0
1920  PyObject *func_weakreflist;
1921 #endif
1922  PyObject *func_dict;
1923  PyObject *func_name;
1924  PyObject *func_qualname;
1925  PyObject *func_doc;
1926  PyObject *func_globals;
1927  PyObject *func_code;
1928  PyObject *func_closure;
1929  PyObject *func_classobj;
1930  void *defaults;
1931  int defaults_pyobjects;
1932  int flags;
1933  PyObject *defaults_tuple;
1934  PyObject *defaults_kwdict;
1935  PyObject *(*defaults_getter)(PyObject *);
1936  PyObject *func_annotations;
1937 } __pyx_CyFunctionObject;
1938 static PyTypeObject *__pyx_CyFunctionType = 0;
1939 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
1940  __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
1941 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1942  int flags, PyObject* qualname,
1943  PyObject *self,
1944  PyObject *module, PyObject *globals,
1945  PyObject* code);
1946 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1947  size_t size,
1948  int pyobjects);
1949 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1950  PyObject *tuple);
1951 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1952  PyObject *dict);
1953 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1954  PyObject *dict);
1955 static int __pyx_CyFunction_init(void);
1956 
1957 /* SetNameInClass.proto */
1958 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1959 #define __Pyx_SetNameInClass(ns, name, value)\
1960  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1961 #elif CYTHON_COMPILING_IN_CPYTHON
1962 #define __Pyx_SetNameInClass(ns, name, value)\
1963  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1964 #else
1965 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1966 #endif
1967 
1968 /* Py3ClassCreate.proto */
1969 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1970  PyObject *mkw, PyObject *modname, PyObject *doc);
1971 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1972  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1973 
1974 /* CLineInTraceback.proto */
1975 #ifdef CYTHON_CLINE_IN_TRACEBACK
1976 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1977 #else
1978 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1979 #endif
1980 
1981 /* CodeObjectCache.proto */
1982 typedef struct {
1983  PyCodeObject* code_object;
1984  int code_line;
1985 } __Pyx_CodeObjectCacheEntry;
1986 struct __Pyx_CodeObjectCache {
1987  int count;
1988  int max_count;
1989  __Pyx_CodeObjectCacheEntry* entries;
1990 };
1991 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1992 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1993 static PyCodeObject *__pyx_find_code_object(int code_line);
1994 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1995 
1996 /* AddTraceback.proto */
1997 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1998  int py_line, const char *filename);
1999 
2000 #if PY_MAJOR_VERSION < 3
2001  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2002  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2003 #else
2004  #define __Pyx_GetBuffer PyObject_GetBuffer
2005  #define __Pyx_ReleaseBuffer PyBuffer_Release
2006 #endif
2007 
2008 
2009 /* BufferStructDeclare.proto */
2010 typedef struct {
2011  Py_ssize_t shape, strides, suboffsets;
2012 } __Pyx_Buf_DimInfo;
2013 typedef struct {
2014  size_t refcount;
2015  Py_buffer pybuffer;
2016 } __Pyx_Buffer;
2017 typedef struct {
2018  __Pyx_Buffer *rcbuffer;
2019  char *data;
2020  __Pyx_Buf_DimInfo diminfo[8];
2021 } __Pyx_LocalBuf_ND;
2022 
2023 /* MemviewSliceIsContig.proto */
2024 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2025 
2026 /* OverlappingSlices.proto */
2027 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2028  __Pyx_memviewslice *slice2,
2029  int ndim, size_t itemsize);
2030 
2031 /* Capsule.proto */
2032 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2033 
2034 /* IsLittleEndian.proto */
2035 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2036 
2037 /* BufferFormatCheck.proto */
2038 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2039 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2040  __Pyx_BufFmt_StackElem* stack,
2041  __Pyx_TypeInfo* type);
2042 
2043 /* TypeInfoCompare.proto */
2044 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2045 
2046 /* MemviewSliceValidateAndInit.proto */
2047 static int __Pyx_ValidateAndInit_memviewslice(
2048  int *axes_specs,
2049  int c_or_f_flag,
2050  int buf_flags,
2051  int ndim,
2052  __Pyx_TypeInfo *dtype,
2053  __Pyx_BufFmt_StackElem stack[],
2054  __Pyx_memviewslice *memviewslice,
2055  PyObject *original_obj);
2056 
2057 /* ObjectToMemviewSlice.proto */
2058 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
2059 
2060 /* ObjectToMemviewSlice.proto */
2061 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag);
2062 
2063 /* CIntToPy.proto */
2064 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
2065 
2066 /* CIntToPy.proto */
2067 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2068 
2069 /* RealImag.proto */
2070 #if CYTHON_CCOMPLEX
2071  #ifdef __cplusplus
2072  #define __Pyx_CREAL(z) ((z).real())
2073  #define __Pyx_CIMAG(z) ((z).imag())
2074  #else
2075  #define __Pyx_CREAL(z) (__real__(z))
2076  #define __Pyx_CIMAG(z) (__imag__(z))
2077  #endif
2078 #else
2079  #define __Pyx_CREAL(z) ((z).real)
2080  #define __Pyx_CIMAG(z) ((z).imag)
2081 #endif
2082 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2083  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2084  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2085  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2086 #else
2087  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2088  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2089 #endif
2090 
2091 /* Arithmetic.proto */
2092 #if CYTHON_CCOMPLEX
2093  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2094  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2095  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2096  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2097  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2098  #define __Pyx_c_neg_float(a) (-(a))
2099  #ifdef __cplusplus
2100  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2101  #define __Pyx_c_conj_float(z) (::std::conj(z))
2102  #if 1
2103  #define __Pyx_c_abs_float(z) (::std::abs(z))
2104  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2105  #endif
2106  #else
2107  #define __Pyx_c_is_zero_float(z) ((z)==0)
2108  #define __Pyx_c_conj_float(z) (conjf(z))
2109  #if 1
2110  #define __Pyx_c_abs_float(z) (cabsf(z))
2111  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2112  #endif
2113  #endif
2114 #else
2115  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2116  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2117  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2118  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2119  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2120  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2121  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2122  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2123  #if 1
2124  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2125  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2126  #endif
2127 #endif
2128 
2129 /* Arithmetic.proto */
2130 #if CYTHON_CCOMPLEX
2131  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2132  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2133  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2134  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2135  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2136  #define __Pyx_c_neg_double(a) (-(a))
2137  #ifdef __cplusplus
2138  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2139  #define __Pyx_c_conj_double(z) (::std::conj(z))
2140  #if 1
2141  #define __Pyx_c_abs_double(z) (::std::abs(z))
2142  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2143  #endif
2144  #else
2145  #define __Pyx_c_is_zero_double(z) ((z)==0)
2146  #define __Pyx_c_conj_double(z) (conj(z))
2147  #if 1
2148  #define __Pyx_c_abs_double(z) (cabs(z))
2149  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2150  #endif
2151  #endif
2152 #else
2153  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2154  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2155  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2156  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2157  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2158  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2159  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2160  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2161  #if 1
2162  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2163  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2164  #endif
2165 #endif
2166 
2167 /* CIntToPy.proto */
2168 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2169 
2170 /* MemviewSliceCopyTemplate.proto */
2171 static __Pyx_memviewslice
2172 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2173  const char *mode, int ndim,
2174  size_t sizeof_dtype, int contig_flag,
2175  int dtype_is_object);
2176 
2177 /* CIntFromPy.proto */
2178 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2179 
2180 /* CIntFromPy.proto */
2181 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
2182 
2183 /* CIntFromPy.proto */
2184 static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
2185 
2186 /* CIntFromPy.proto */
2187 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2188 
2189 /* CIntToPy.proto */
2190 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2191 
2192 /* CIntFromPy.proto */
2193 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2194 
2195 /* CheckBinaryVersion.proto */
2196 static int __Pyx_check_binary_version(void);
2197 
2198 /* PyIdentifierFromString.proto */
2199 #if !defined(__Pyx_PyIdentifier_FromString)
2200 #if PY_MAJOR_VERSION < 3
2201  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
2202 #else
2203  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
2204 #endif
2205 #endif
2206 
2207 /* ModuleImport.proto */
2208 static PyObject *__Pyx_ImportModule(const char *name);
2209 
2210 /* TypeImport.proto */
2211 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
2212 
2213 /* InitStrings.proto */
2214 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2215 
2216 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto*/
2217 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2218 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2219 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2220 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2221 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2222 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2223 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2224 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2225 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2226 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2227 
2228 /* Module declarations from 'cpython.buffer' */
2229 
2230 /* Module declarations from 'libc.string' */
2231 
2232 /* Module declarations from 'libc.stdio' */
2233 
2234 /* Module declarations from '__builtin__' */
2235 
2236 /* Module declarations from 'cpython.type' */
2237 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2238 
2239 /* Module declarations from 'cpython' */
2240 
2241 /* Module declarations from 'cpython.object' */
2242 
2243 /* Module declarations from 'cpython.ref' */
2244 
2245 /* Module declarations from 'cpython.mem' */
2246 
2247 /* Module declarations from 'numpy' */
2248 
2249 /* Module declarations from 'numpy' */
2250 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2251 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2252 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2253 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2254 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2255 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2256 
2257 /* Module declarations from 'cython.view' */
2258 
2259 /* Module declarations from 'cython' */
2260 
2261 /* Module declarations from 'libc.stdlib' */
2262 
2263 /* Module declarations from 'superluWrappers' */
2264 static PyTypeObject *__pyx_ptype_15superluWrappers_cSparseMatrix = 0;
2265 static PyTypeObject *__pyx_ptype_15superluWrappers_SparseFactor = 0;
2266 static PyTypeObject *__pyx_array_type = 0;
2267 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2268 static PyTypeObject *__pyx_memoryview_type = 0;
2269 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2270 static PyObject *generic = 0;
2271 static PyObject *strided = 0;
2272 static PyObject *indirect = 0;
2273 static PyObject *contiguous = 0;
2274 static PyObject *indirect_contiguous = 0;
2275 static int __pyx_memoryview_thread_locks_used;
2276 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2277 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2278 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *, struct __pyx_obj_15superluWrappers_SparseFactor *); /*proto*/
2279 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *, __Pyx_memviewslice); /*proto*/
2280 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2281 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2282 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2283 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2284 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2285 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2286 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2287 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2288 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2289 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2290 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2291 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2292 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2293 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2294 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2295 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2296 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2297 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2298 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2299 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2300 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2301 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2302 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2303 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2304 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2305 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2306 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2307 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2308 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2309 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2310 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2311 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2312 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2313 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
2314 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
2315 #define __Pyx_MODULE_NAME "superluWrappers"
2316 extern int __pyx_module_is_main_superluWrappers;
2317 int __pyx_module_is_main_superluWrappers = 0;
2318 
2319 /* Implementation of 'superluWrappers' */
2320 static PyObject *__pyx_builtin_object;
2321 static PyObject *__pyx_builtin_open;
2322 static PyObject *__pyx_builtin_range;
2323 static PyObject *__pyx_builtin_TypeError;
2324 static PyObject *__pyx_builtin_ValueError;
2325 static PyObject *__pyx_builtin_RuntimeError;
2326 static PyObject *__pyx_builtin_ImportError;
2327 static PyObject *__pyx_builtin_MemoryError;
2328 static PyObject *__pyx_builtin_enumerate;
2329 static PyObject *__pyx_builtin_Ellipsis;
2330 static PyObject *__pyx_builtin_id;
2331 static PyObject *__pyx_builtin_IndexError;
2332 static const char __pyx_k_O[] = "O";
2333 static const char __pyx_k_c[] = "c";
2334 static const char __pyx_k_i[] = "i";
2335 static const char __pyx_k_k[] = "k";
2336 static const char __pyx_k_w[] = "w";
2337 static const char __pyx_k_x[] = "x";
2338 static const char __pyx_k_y[] = "y";
2339 static const char __pyx_k_id[] = "id";
2340 static const char __pyx_k_nc[] = "nc";
2341 static const char __pyx_k_np[] = "np";
2342 static const char __pyx_k_nr[] = "nr";
2343 static const char __pyx_k_dim[] = "dim";
2344 static const char __pyx_k_doc[] = "__doc__";
2345 static const char __pyx_k_new[] = "__new__";
2346 static const char __pyx_k_nnz[] = "nnz";
2347 static const char __pyx_k_obj[] = "obj";
2348 static const char __pyx_k_base[] = "base";
2349 static const char __pyx_k_dict[] = "__dict__";
2350 static const char __pyx_k_exit[] = "__exit__";
2351 static const char __pyx_k_init[] = "__init__";
2352 static const char __pyx_k_main[] = "__main__";
2353 static const char __pyx_k_mode[] = "mode";
2354 static const char __pyx_k_name[] = "name";
2355 static const char __pyx_k_ndim[] = "ndim";
2356 static const char __pyx_k_open[] = "open";
2357 static const char __pyx_k_pack[] = "pack";
2358 static const char __pyx_k_rows[] = "_rows";
2359 static const char __pyx_k_self[] = "self";
2360 static const char __pyx_k_size[] = "size";
2361 static const char __pyx_k_step[] = "step";
2362 static const char __pyx_k_stop[] = "stop";
2363 static const char __pyx_k_test[] = "__test__";
2364 static const char __pyx_k_ASCII[] = "ASCII";
2365 static const char __pyx_k_class[] = "__class__";
2366 static const char __pyx_k_enter[] = "__enter__";
2367 static const char __pyx_k_error[] = "error";
2368 static const char __pyx_k_flags[] = "flags";
2369 static const char __pyx_k_i_i_i[] = "%i %i %i \n";
2370 static const char __pyx_k_numpy[] = "numpy";
2371 static const char __pyx_k_nzval[] = "nzval";
2372 static const char __pyx_k_range[] = "range";
2373 static const char __pyx_k_shape[] = "shape";
2374 static const char __pyx_k_start[] = "start";
2375 static const char __pyx_k_write[] = "write";
2376 static const char __pyx_k_colind[] = "colind";
2377 static const char __pyx_k_encode[] = "encode";
2378 static const char __pyx_k_format[] = "format";
2379 static const char __pyx_k_fwrite[] = "fwrite";
2380 static const char __pyx_k_import[] = "__import__";
2381 static const char __pyx_k_matvec[] = "matvec";
2382 static const char __pyx_k_module[] = "__module__";
2383 static const char __pyx_k_name_2[] = "__name__";
2384 static const char __pyx_k_nzvals[] = "nzvals";
2385 static const char __pyx_k_object[] = "object";
2386 static const char __pyx_k_pickle[] = "pickle";
2387 static const char __pyx_k_reduce[] = "__reduce__";
2388 static const char __pyx_k_rowptr[] = "rowptr";
2389 static const char __pyx_k_struct[] = "struct";
2390 static const char __pyx_k_unpack[] = "unpack";
2391 static const char __pyx_k_update[] = "update";
2392 static const char __pyx_k_fortran[] = "fortran";
2393 static const char __pyx_k_memview[] = "memview";
2394 static const char __pyx_k_prepare[] = "__prepare__";
2395 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2396 static const char __pyx_k_filename[] = "filename";
2397 static const char __pyx_k_getstate[] = "__getstate__";
2398 static const char __pyx_k_itemsize[] = "itemsize";
2399 static const char __pyx_k_pyx_type[] = "__pyx_type";
2400 static const char __pyx_k_qualname[] = "__qualname__";
2401 static const char __pyx_k_setstate[] = "__setstate__";
2402 static const char __pyx_k_TypeError[] = "TypeError";
2403 static const char __pyx_k_d_d_13_8e[] = "%d %d %13.8e\n";
2404 static const char __pyx_k_enumerate[] = "enumerate";
2405 static const char __pyx_k_metaclass[] = "__metaclass__";
2406 static const char __pyx_k_pyx_state[] = "__pyx_state";
2407 static const char __pyx_k_range_end[] = "range_end";
2408 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2409 static const char __pyx_k_IndexError[] = "IndexError";
2410 static const char __pyx_k_ValueError[] = "ValueError";
2411 static const char __pyx_k_pyx_result[] = "__pyx_result";
2412 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2413 static const char __pyx_k_ImportError[] = "ImportError";
2414 static const char __pyx_k_MemoryError[] = "MemoryError";
2415 static const char __pyx_k_PickleError[] = "PickleError";
2416 static const char __pyx_k_output_file[] = "output_file";
2417 static const char __pyx_k_range_start[] = "range_start";
2418 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2419 static const char __pyx_k_SparseMatrix[] = "SparseMatrix";
2420 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2421 static const char __pyx_k_sparseFactor[] = "sparseFactor";
2422 static const char __pyx_k_stringsource[] = "stringsource";
2423 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2424 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2425 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2426 static const char __pyx_k_sparse_matrix[] = "sparse_matrix";
2427 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2428 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2429 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2430 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2431 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2432 static const char __pyx_k_superluWrappers[] = "superluWrappers";
2433 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2434 static const char __pyx_k_sparseFactorSolve[] = "sparseFactorSolve";
2435 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2436 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2437 static const char __pyx_k_SparseMatrix___init[] = "SparseMatrix.__init__";
2438 static const char __pyx_k_SparseMatrix_fwrite[] = "SparseMatrix.fwrite";
2439 static const char __pyx_k_SparseMatrix_matvec[] = "SparseMatrix.matvec";
2440 static const char __pyx_k_sparseFactorPrepare[] = "sparseFactorPrepare";
2441 static const char __pyx_k_getCSRrepresentation[] = "getCSRrepresentation";
2442 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2443 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2444 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2445 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2446 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2447 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2448 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2449 static const char __pyx_k_getSubMatCSRrepresentation[] = "getSubMatCSRrepresentation";
2450 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2451 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2452 static const char __pyx_k_proteus_superluWrappers_pyx[] = "proteus/superluWrappers.pyx";
2453 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2454 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2455 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2456 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2457 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2458 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2459 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2460 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2461 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2462 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2463 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2464 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2465 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2466 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2467 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2468 static const char __pyx_k_SparseMatrix_getCSRrepresentatio[] = "SparseMatrix.getCSRrepresentation";
2469 static const char __pyx_k_SparseMatrix_getSubMatCSRreprese[] = "SparseMatrix.getSubMatCSRrepresentation";
2470 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2471 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2472 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2473 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2474 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2475 static const char __pyx_k_self_A_self_AC_self_L_self_U_sel[] = "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling";
2476 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2477 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2478 static PyObject *__pyx_n_s_ASCII;
2479 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2480 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2481 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2482 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2483 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2484 static PyObject *__pyx_n_s_Ellipsis;
2485 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2486 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2487 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2488 static PyObject *__pyx_n_s_ImportError;
2489 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2490 static PyObject *__pyx_n_s_IndexError;
2491 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2492 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2493 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2494 static PyObject *__pyx_n_s_MemoryError;
2495 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2496 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2497 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2498 static PyObject *__pyx_n_b_O;
2499 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2500 static PyObject *__pyx_n_s_PickleError;
2501 static PyObject *__pyx_n_s_RuntimeError;
2502 static PyObject *__pyx_n_s_SparseMatrix;
2503 static PyObject *__pyx_n_s_SparseMatrix___init;
2504 static PyObject *__pyx_n_s_SparseMatrix_fwrite;
2505 static PyObject *__pyx_n_s_SparseMatrix_getCSRrepresentatio;
2506 static PyObject *__pyx_n_s_SparseMatrix_getSubMatCSRreprese;
2507 static PyObject *__pyx_n_s_SparseMatrix_matvec;
2508 static PyObject *__pyx_n_s_TypeError;
2509 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2510 static PyObject *__pyx_n_s_ValueError;
2511 static PyObject *__pyx_n_s_View_MemoryView;
2512 static PyObject *__pyx_n_s_allocate_buffer;
2513 static PyObject *__pyx_n_s_base;
2514 static PyObject *__pyx_n_s_c;
2515 static PyObject *__pyx_n_u_c;
2516 static PyObject *__pyx_n_s_cSparseMatrix;
2517 static PyObject *__pyx_n_s_class;
2518 static PyObject *__pyx_n_s_cline_in_traceback;
2519 static PyObject *__pyx_n_s_colind;
2520 static PyObject *__pyx_kp_s_contiguous_and_direct;
2521 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2522 static PyObject *__pyx_kp_s_d_d_13_8e;
2523 static PyObject *__pyx_n_s_dict;
2524 static PyObject *__pyx_n_s_dim;
2525 static PyObject *__pyx_n_s_doc;
2526 static PyObject *__pyx_n_s_dtype_is_object;
2527 static PyObject *__pyx_n_s_encode;
2528 static PyObject *__pyx_n_s_enter;
2529 static PyObject *__pyx_n_s_enumerate;
2530 static PyObject *__pyx_n_s_error;
2531 static PyObject *__pyx_n_s_exit;
2532 static PyObject *__pyx_n_s_filename;
2533 static PyObject *__pyx_n_s_flags;
2534 static PyObject *__pyx_n_s_format;
2535 static PyObject *__pyx_n_s_fortran;
2536 static PyObject *__pyx_n_u_fortran;
2537 static PyObject *__pyx_n_s_fwrite;
2538 static PyObject *__pyx_n_s_getCSRrepresentation;
2539 static PyObject *__pyx_n_s_getSubMatCSRrepresentation;
2540 static PyObject *__pyx_n_s_getstate;
2541 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2542 static PyObject *__pyx_n_s_i;
2543 static PyObject *__pyx_kp_s_i_i_i;
2544 static PyObject *__pyx_n_s_id;
2545 static PyObject *__pyx_n_s_import;
2546 static PyObject *__pyx_n_s_init;
2547 static PyObject *__pyx_n_s_itemsize;
2548 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2549 static PyObject *__pyx_n_s_k;
2550 static PyObject *__pyx_n_s_main;
2551 static PyObject *__pyx_n_s_matvec;
2552 static PyObject *__pyx_n_s_memview;
2553 static PyObject *__pyx_n_s_metaclass;
2554 static PyObject *__pyx_n_s_mode;
2555 static PyObject *__pyx_n_s_module;
2556 static PyObject *__pyx_n_s_name;
2557 static PyObject *__pyx_n_s_name_2;
2558 static PyObject *__pyx_n_s_nc;
2559 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2560 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2561 static PyObject *__pyx_n_s_ndim;
2562 static PyObject *__pyx_n_s_new;
2563 static PyObject *__pyx_n_s_nnz;
2564 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2565 static PyObject *__pyx_n_s_np;
2566 static PyObject *__pyx_n_s_nr;
2567 static PyObject *__pyx_n_s_numpy;
2568 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2569 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2570 static PyObject *__pyx_n_s_nzval;
2571 static PyObject *__pyx_n_s_nzvals;
2572 static PyObject *__pyx_n_s_obj;
2573 static PyObject *__pyx_n_s_object;
2574 static PyObject *__pyx_n_s_open;
2575 static PyObject *__pyx_n_s_output_file;
2576 static PyObject *__pyx_n_s_pack;
2577 static PyObject *__pyx_n_s_pickle;
2578 static PyObject *__pyx_n_s_prepare;
2579 static PyObject *__pyx_kp_s_proteus_superluWrappers_pyx;
2580 static PyObject *__pyx_n_s_pyx_PickleError;
2581 static PyObject *__pyx_n_s_pyx_checksum;
2582 static PyObject *__pyx_n_s_pyx_getbuffer;
2583 static PyObject *__pyx_n_s_pyx_result;
2584 static PyObject *__pyx_n_s_pyx_state;
2585 static PyObject *__pyx_n_s_pyx_type;
2586 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2587 static PyObject *__pyx_n_s_pyx_vtable;
2588 static PyObject *__pyx_n_s_qualname;
2589 static PyObject *__pyx_n_s_range;
2590 static PyObject *__pyx_n_s_range_end;
2591 static PyObject *__pyx_n_s_range_start;
2592 static PyObject *__pyx_n_s_reduce;
2593 static PyObject *__pyx_n_s_reduce_cython;
2594 static PyObject *__pyx_n_s_reduce_ex;
2595 static PyObject *__pyx_n_s_rowptr;
2596 static PyObject *__pyx_n_s_rows;
2597 static PyObject *__pyx_n_s_self;
2598 static PyObject *__pyx_kp_s_self_A_self_AC_self_L_self_U_sel;
2599 static PyObject *__pyx_n_s_setstate;
2600 static PyObject *__pyx_n_s_setstate_cython;
2601 static PyObject *__pyx_n_s_shape;
2602 static PyObject *__pyx_n_s_size;
2603 static PyObject *__pyx_n_s_sparseFactor;
2604 static PyObject *__pyx_n_s_sparseFactorPrepare;
2605 static PyObject *__pyx_n_s_sparseFactorSolve;
2606 static PyObject *__pyx_n_s_sparse_matrix;
2607 static PyObject *__pyx_n_s_start;
2608 static PyObject *__pyx_n_s_step;
2609 static PyObject *__pyx_n_s_stop;
2610 static PyObject *__pyx_kp_s_strided_and_direct;
2611 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2612 static PyObject *__pyx_kp_s_strided_and_indirect;
2613 static PyObject *__pyx_kp_s_stringsource;
2614 static PyObject *__pyx_n_s_struct;
2615 static PyObject *__pyx_n_s_superluWrappers;
2616 static PyObject *__pyx_n_s_test;
2617 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2618 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2619 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2620 static PyObject *__pyx_n_s_unpack;
2621 static PyObject *__pyx_n_s_update;
2622 static PyObject *__pyx_n_s_w;
2623 static PyObject *__pyx_n_s_write;
2624 static PyObject *__pyx_n_s_x;
2625 static PyObject *__pyx_n_s_y;
2626 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr); /* proto */
2627 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
2628 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base); /* proto */
2629 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2630 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end); /* proto */
2631 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr); /* proto */
2632 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self); /* proto */
2633 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2634 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
2635 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
2636 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2637 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
2638 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2639 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor); /* proto */
2640 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x); /* proto */
2641 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2642 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2643 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2644 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2645 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2646 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2647 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2648 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2649 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2650 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2651 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2652 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2653 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2654 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2655 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2656 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2657 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2658 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2659 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2660 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2661 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2662 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2663 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2664 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2665 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2666 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2667 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2668 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2669 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2670 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2671 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2672 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2673 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2674 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2675 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2676 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2677 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2678 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2679 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2680 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2681 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2682 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2683 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2684 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2685 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2686 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2687 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2688 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2689 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2690 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2691 static PyObject *__pyx_int_0;
2692 static PyObject *__pyx_int_1;
2693 static PyObject *__pyx_int_184977713;
2694 static PyObject *__pyx_int_neg_1;
2695 static PyObject *__pyx_tuple_;
2696 static PyObject *__pyx_tuple__2;
2697 static PyObject *__pyx_tuple__3;
2698 static PyObject *__pyx_tuple__4;
2699 static PyObject *__pyx_tuple__5;
2700 static PyObject *__pyx_tuple__6;
2701 static PyObject *__pyx_tuple__7;
2702 static PyObject *__pyx_tuple__8;
2703 static PyObject *__pyx_tuple__9;
2704 static PyObject *__pyx_slice__30;
2705 static PyObject *__pyx_slice__31;
2706 static PyObject *__pyx_slice__32;
2707 static PyObject *__pyx_tuple__10;
2708 static PyObject *__pyx_tuple__11;
2709 static PyObject *__pyx_tuple__12;
2710 static PyObject *__pyx_tuple__13;
2711 static PyObject *__pyx_tuple__14;
2712 static PyObject *__pyx_tuple__15;
2713 static PyObject *__pyx_tuple__16;
2714 static PyObject *__pyx_tuple__17;
2715 static PyObject *__pyx_tuple__18;
2716 static PyObject *__pyx_tuple__19;
2717 static PyObject *__pyx_tuple__20;
2718 static PyObject *__pyx_tuple__21;
2719 static PyObject *__pyx_tuple__22;
2720 static PyObject *__pyx_tuple__23;
2721 static PyObject *__pyx_tuple__24;
2722 static PyObject *__pyx_tuple__25;
2723 static PyObject *__pyx_tuple__26;
2724 static PyObject *__pyx_tuple__27;
2725 static PyObject *__pyx_tuple__28;
2726 static PyObject *__pyx_tuple__29;
2727 static PyObject *__pyx_tuple__33;
2728 static PyObject *__pyx_tuple__34;
2729 static PyObject *__pyx_tuple__35;
2730 static PyObject *__pyx_tuple__36;
2731 static PyObject *__pyx_tuple__37;
2732 static PyObject *__pyx_tuple__39;
2733 static PyObject *__pyx_tuple__41;
2734 static PyObject *__pyx_tuple__43;
2735 static PyObject *__pyx_tuple__45;
2736 static PyObject *__pyx_tuple__47;
2737 static PyObject *__pyx_tuple__49;
2738 static PyObject *__pyx_tuple__51;
2739 static PyObject *__pyx_tuple__52;
2740 static PyObject *__pyx_tuple__53;
2741 static PyObject *__pyx_tuple__54;
2742 static PyObject *__pyx_tuple__55;
2743 static PyObject *__pyx_tuple__56;
2744 static PyObject *__pyx_codeobj__38;
2745 static PyObject *__pyx_codeobj__40;
2746 static PyObject *__pyx_codeobj__42;
2747 static PyObject *__pyx_codeobj__44;
2748 static PyObject *__pyx_codeobj__46;
2749 static PyObject *__pyx_codeobj__48;
2750 static PyObject *__pyx_codeobj__50;
2751 static PyObject *__pyx_codeobj__57;
2752 /* Late includes */
2753 
2754 /* "superluWrappers.pyx":15
2755  * class SparseMatrix(object):
2756  *
2757  * def __init__(self, # <<<<<<<<<<<<<<
2758  * nr,
2759  * nc,
2760  */
2761 
2762 /* Python wrapper */
2763 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2764 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_1__init__ = {"__init__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2765 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2766  PyObject *__pyx_v_self = 0;
2767  PyObject *__pyx_v_nr = 0;
2768  PyObject *__pyx_v_nc = 0;
2769  PyObject *__pyx_v_nnz = 0;
2770  PyObject *__pyx_v_nzvals = 0;
2771  PyObject *__pyx_v_colind = 0;
2772  PyObject *__pyx_v_rowptr = 0;
2773  PyObject *__pyx_r = 0;
2774  __Pyx_RefNannyDeclarations
2775  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2776  {
2777  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzvals,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
2778  PyObject* values[7] = {0,0,0,0,0,0,0};
2779  if (unlikely(__pyx_kwds)) {
2780  Py_ssize_t kw_args;
2781  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2782  switch (pos_args) {
2783  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2784  CYTHON_FALLTHROUGH;
2785  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2786  CYTHON_FALLTHROUGH;
2787  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2788  CYTHON_FALLTHROUGH;
2789  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2790  CYTHON_FALLTHROUGH;
2791  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2792  CYTHON_FALLTHROUGH;
2793  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2794  CYTHON_FALLTHROUGH;
2795  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2796  CYTHON_FALLTHROUGH;
2797  case 0: break;
2798  default: goto __pyx_L5_argtuple_error;
2799  }
2800  kw_args = PyDict_Size(__pyx_kwds);
2801  switch (pos_args) {
2802  case 0:
2803  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2804  else goto __pyx_L5_argtuple_error;
2805  CYTHON_FALLTHROUGH;
2806  case 1:
2807  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
2808  else {
2809  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 15, __pyx_L3_error)
2810  }
2811  CYTHON_FALLTHROUGH;
2812  case 2:
2813  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
2814  else {
2815  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 15, __pyx_L3_error)
2816  }
2817  CYTHON_FALLTHROUGH;
2818  case 3:
2819  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
2820  else {
2821  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 15, __pyx_L3_error)
2822  }
2823  CYTHON_FALLTHROUGH;
2824  case 4:
2825  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzvals)) != 0)) kw_args--;
2826  else {
2827  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 15, __pyx_L3_error)
2828  }
2829  CYTHON_FALLTHROUGH;
2830  case 5:
2831  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
2832  else {
2833  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 15, __pyx_L3_error)
2834  }
2835  CYTHON_FALLTHROUGH;
2836  case 6:
2837  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
2838  else {
2839  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 15, __pyx_L3_error)
2840  }
2841  }
2842  if (unlikely(kw_args > 0)) {
2843  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 15, __pyx_L3_error)
2844  }
2845  } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
2846  goto __pyx_L5_argtuple_error;
2847  } else {
2848  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2849  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2850  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2851  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2852  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2853  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2854  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2855  }
2856  __pyx_v_self = values[0];
2857  __pyx_v_nr = values[1];
2858  __pyx_v_nc = values[2];
2859  __pyx_v_nnz = values[3];
2860  __pyx_v_nzvals = values[4];
2861  __pyx_v_colind = values[5];
2862  __pyx_v_rowptr = values[6];
2863  }
2864  goto __pyx_L4_argument_unpacking_done;
2865  __pyx_L5_argtuple_error:;
2866  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 15, __pyx_L3_error)
2867  __pyx_L3_error:;
2868  __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2869  __Pyx_RefNannyFinishContext();
2870  return NULL;
2871  __pyx_L4_argument_unpacking_done:;
2872  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix___init__(__pyx_self, __pyx_v_self, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzvals, __pyx_v_colind, __pyx_v_rowptr);
2873 
2874  /* function exit code */
2875  __Pyx_RefNannyFinishContext();
2876  return __pyx_r;
2877 }
2878 
2879 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr) {
2880  PyObject *__pyx_r = NULL;
2881  __Pyx_RefNannyDeclarations
2882  PyObject *__pyx_t_1 = NULL;
2883  PyObject *__pyx_t_2 = NULL;
2884  PyObject *__pyx_t_3 = NULL;
2885  PyObject *__pyx_t_4 = NULL;
2886  __Pyx_RefNannySetupContext("__init__", 0);
2887 
2888  /* "superluWrappers.pyx":22
2889  * colind,
2890  * rowptr):
2891  * self.nr = nr ; self.nc = nc # <<<<<<<<<<<<<<
2892  * self.nnz = nnz
2893  * self.shape = [self.nr, self.nc]
2894  */
2895  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nr, __pyx_v_nr) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
2896  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc, __pyx_v_nc) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
2897 
2898  /* "superluWrappers.pyx":23
2899  * rowptr):
2900  * self.nr = nr ; self.nc = nc
2901  * self.nnz = nnz # <<<<<<<<<<<<<<
2902  * self.shape = [self.nr, self.nc]
2903  * self.nzvals = nzvals
2904  */
2905  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nnz, __pyx_v_nnz) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
2906 
2907  /* "superluWrappers.pyx":24
2908  * self.nr = nr ; self.nc = nc
2909  * self.nnz = nnz
2910  * self.shape = [self.nr, self.nc] # <<<<<<<<<<<<<<
2911  * self.nzvals = nzvals
2912  * self.colind = colind
2913  */
2914  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
2915  __Pyx_GOTREF(__pyx_t_1);
2916  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
2917  __Pyx_GOTREF(__pyx_t_2);
2918  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
2919  __Pyx_GOTREF(__pyx_t_3);
2920  __Pyx_GIVEREF(__pyx_t_1);
2921  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2922  __Pyx_GIVEREF(__pyx_t_2);
2923  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
2924  __pyx_t_1 = 0;
2925  __pyx_t_2 = 0;
2926  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
2927  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2928 
2929  /* "superluWrappers.pyx":25
2930  * self.nnz = nnz
2931  * self.shape = [self.nr, self.nc]
2932  * self.nzvals = nzvals # <<<<<<<<<<<<<<
2933  * self.colind = colind
2934  * self.rowptr = rowptr
2935  */
2936  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nzvals, __pyx_v_nzvals) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
2937 
2938  /* "superluWrappers.pyx":26
2939  * self.shape = [self.nr, self.nc]
2940  * self.nzvals = nzvals
2941  * self.colind = colind # <<<<<<<<<<<<<<
2942  * self.rowptr = rowptr
2943  * self._cSparseMatrix = cSparseMatrix(nr,
2944  */
2945  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_colind, __pyx_v_colind) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
2946 
2947  /* "superluWrappers.pyx":27
2948  * self.nzvals = nzvals
2949  * self.colind = colind
2950  * self.rowptr = rowptr # <<<<<<<<<<<<<<
2951  * self._cSparseMatrix = cSparseMatrix(nr,
2952  * nc,
2953  */
2954  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rowptr, __pyx_v_rowptr) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
2955 
2956  /* "superluWrappers.pyx":31
2957  * nc,
2958  * nnz,
2959  * self.nzvals, # <<<<<<<<<<<<<<
2960  * self.colind,
2961  * self.rowptr)
2962  */
2963  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
2964  __Pyx_GOTREF(__pyx_t_3);
2965 
2966  /* "superluWrappers.pyx":32
2967  * nnz,
2968  * self.nzvals,
2969  * self.colind, # <<<<<<<<<<<<<<
2970  * self.rowptr)
2971  *
2972  */
2973  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
2974  __Pyx_GOTREF(__pyx_t_2);
2975 
2976  /* "superluWrappers.pyx":33
2977  * self.nzvals,
2978  * self.colind,
2979  * self.rowptr) # <<<<<<<<<<<<<<
2980  *
2981  * def matvec(self, x, y):
2982  */
2983  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
2984  __Pyx_GOTREF(__pyx_t_1);
2985 
2986  /* "superluWrappers.pyx":28
2987  * self.colind = colind
2988  * self.rowptr = rowptr
2989  * self._cSparseMatrix = cSparseMatrix(nr, # <<<<<<<<<<<<<<
2990  * nc,
2991  * nnz,
2992  */
2993  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
2994  __Pyx_GOTREF(__pyx_t_4);
2995  __Pyx_INCREF(__pyx_v_nr);
2996  __Pyx_GIVEREF(__pyx_v_nr);
2997  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nr);
2998  __Pyx_INCREF(__pyx_v_nc);
2999  __Pyx_GIVEREF(__pyx_v_nc);
3000  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_nc);
3001  __Pyx_INCREF(__pyx_v_nnz);
3002  __Pyx_GIVEREF(__pyx_v_nnz);
3003  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nnz);
3004  __Pyx_GIVEREF(__pyx_t_3);
3005  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
3006  __Pyx_GIVEREF(__pyx_t_2);
3007  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2);
3008  __Pyx_GIVEREF(__pyx_t_1);
3009  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1);
3010  __pyx_t_3 = 0;
3011  __pyx_t_2 = 0;
3012  __pyx_t_1 = 0;
3013  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_15superluWrappers_cSparseMatrix), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3014  __Pyx_GOTREF(__pyx_t_1);
3015  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3016  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3017  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3018 
3019  /* "superluWrappers.pyx":15
3020  * class SparseMatrix(object):
3021  *
3022  * def __init__(self, # <<<<<<<<<<<<<<
3023  * nr,
3024  * nc,
3025  */
3026 
3027  /* function exit code */
3028  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3029  goto __pyx_L0;
3030  __pyx_L1_error:;
3031  __Pyx_XDECREF(__pyx_t_1);
3032  __Pyx_XDECREF(__pyx_t_2);
3033  __Pyx_XDECREF(__pyx_t_3);
3034  __Pyx_XDECREF(__pyx_t_4);
3035  __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3036  __pyx_r = NULL;
3037  __pyx_L0:;
3038  __Pyx_XGIVEREF(__pyx_r);
3039  __Pyx_RefNannyFinishContext();
3040  return __pyx_r;
3041 }
3042 
3043 /* "superluWrappers.pyx":35
3044  * self.rowptr)
3045  *
3046  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3047  * """
3048  * Compute the sparse matrix-vector product y = Ax
3049  */
3050 
3051 /* Python wrapper */
3052 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3053 static char __pyx_doc_15superluWrappers_12SparseMatrix_2matvec[] = "\n Compute the sparse matrix-vector product y = Ax\n\n Arguments\n ---------\n x (input) : numpy array\n y (output) : numpy array\n ";
3054 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_3matvec = {"matvec", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_3matvec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_2matvec};
3055 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3056  PyObject *__pyx_v_self = 0;
3057  PyObject *__pyx_v_x = 0;
3058  PyObject *__pyx_v_y = 0;
3059  PyObject *__pyx_r = 0;
3060  __Pyx_RefNannyDeclarations
3061  __Pyx_RefNannySetupContext("matvec (wrapper)", 0);
3062  {
3063  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
3064  PyObject* values[3] = {0,0,0};
3065  if (unlikely(__pyx_kwds)) {
3066  Py_ssize_t kw_args;
3067  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3068  switch (pos_args) {
3069  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3070  CYTHON_FALLTHROUGH;
3071  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3072  CYTHON_FALLTHROUGH;
3073  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3074  CYTHON_FALLTHROUGH;
3075  case 0: break;
3076  default: goto __pyx_L5_argtuple_error;
3077  }
3078  kw_args = PyDict_Size(__pyx_kwds);
3079  switch (pos_args) {
3080  case 0:
3081  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3082  else goto __pyx_L5_argtuple_error;
3083  CYTHON_FALLTHROUGH;
3084  case 1:
3085  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3086  else {
3087  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3088  }
3089  CYTHON_FALLTHROUGH;
3090  case 2:
3091  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3092  else {
3093  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3094  }
3095  }
3096  if (unlikely(kw_args > 0)) {
3097  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matvec") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
3098  }
3099  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3100  goto __pyx_L5_argtuple_error;
3101  } else {
3102  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3103  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3104  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3105  }
3106  __pyx_v_self = values[0];
3107  __pyx_v_x = values[1];
3108  __pyx_v_y = values[2];
3109  }
3110  goto __pyx_L4_argument_unpacking_done;
3111  __pyx_L5_argtuple_error:;
3112  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
3113  __pyx_L3_error:;
3114  __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3115  __Pyx_RefNannyFinishContext();
3116  return NULL;
3117  __pyx_L4_argument_unpacking_done:;
3118  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_2matvec(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);
3119 
3120  /* function exit code */
3121  __Pyx_RefNannyFinishContext();
3122  return __pyx_r;
3123 }
3124 
3125 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
3126  PyObject *__pyx_r = NULL;
3127  __Pyx_RefNannyDeclarations
3128  PyObject *__pyx_t_1 = NULL;
3129  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
3130  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
3131  __Pyx_RefNannySetupContext("matvec", 0);
3132 
3133  /* "superluWrappers.pyx":44
3134  * y (output) : numpy array
3135  * """
3136  * SparseMatrix_matvec(self._cSparseMatrix, x, y) # <<<<<<<<<<<<<<
3137  *
3138  * def fwrite(self, filename, base):
3139  */
3140  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
3141  __Pyx_GOTREF(__pyx_t_1);
3142  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 44, __pyx_L1_error)
3143  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3144  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_y, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3145  __pyx_f_15superluWrappers_SparseMatrix_matvec(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3);
3146  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3147  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3148  __pyx_t_2.memview = NULL;
3149  __pyx_t_2.data = NULL;
3150  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3151  __pyx_t_3.memview = NULL;
3152  __pyx_t_3.data = NULL;
3153 
3154  /* "superluWrappers.pyx":35
3155  * self.rowptr)
3156  *
3157  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3158  * """
3159  * Compute the sparse matrix-vector product y = Ax
3160  */
3161 
3162  /* function exit code */
3163  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3164  goto __pyx_L0;
3165  __pyx_L1_error:;
3166  __Pyx_XDECREF(__pyx_t_1);
3167  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3168  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3169  __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3170  __pyx_r = NULL;
3171  __pyx_L0:;
3172  __Pyx_XGIVEREF(__pyx_r);
3173  __Pyx_RefNannyFinishContext();
3174  return __pyx_r;
3175 }
3176 
3177 /* "superluWrappers.pyx":46
3178  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3179  *
3180  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3181  * """ Write the sparse matrix to a file
3182  *
3183  */
3184 
3185 /* Python wrapper */
3186 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3187 static char __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite[] = " Write the sparse matrix to a file\n\n Arguments\n ---------\n filename : str\n The output filename\n base : int\n ?!Possibly something to do with parallel?!\n ";
3188 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite = {"fwrite", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite};
3189 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3190  PyObject *__pyx_v_self = 0;
3191  PyObject *__pyx_v_filename = 0;
3192  PyObject *__pyx_v_base = 0;
3193  PyObject *__pyx_r = 0;
3194  __Pyx_RefNannyDeclarations
3195  __Pyx_RefNannySetupContext("fwrite (wrapper)", 0);
3196  {
3197  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,&__pyx_n_s_base,0};
3198  PyObject* values[3] = {0,0,0};
3199  if (unlikely(__pyx_kwds)) {
3200  Py_ssize_t kw_args;
3201  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3202  switch (pos_args) {
3203  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3204  CYTHON_FALLTHROUGH;
3205  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3206  CYTHON_FALLTHROUGH;
3207  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3208  CYTHON_FALLTHROUGH;
3209  case 0: break;
3210  default: goto __pyx_L5_argtuple_error;
3211  }
3212  kw_args = PyDict_Size(__pyx_kwds);
3213  switch (pos_args) {
3214  case 0:
3215  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3216  else goto __pyx_L5_argtuple_error;
3217  CYTHON_FALLTHROUGH;
3218  case 1:
3219  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
3220  else {
3221  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 1); __PYX_ERR(0, 46, __pyx_L3_error)
3222  }
3223  CYTHON_FALLTHROUGH;
3224  case 2:
3225  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
3226  else {
3227  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 2); __PYX_ERR(0, 46, __pyx_L3_error)
3228  }
3229  }
3230  if (unlikely(kw_args > 0)) {
3231  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fwrite") < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
3232  }
3233  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3234  goto __pyx_L5_argtuple_error;
3235  } else {
3236  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3237  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3238  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3239  }
3240  __pyx_v_self = values[0];
3241  __pyx_v_filename = values[1];
3242  __pyx_v_base = values[2];
3243  }
3244  goto __pyx_L4_argument_unpacking_done;
3245  __pyx_L5_argtuple_error:;
3246  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error)
3247  __pyx_L3_error:;
3248  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3249  __Pyx_RefNannyFinishContext();
3250  return NULL;
3251  __pyx_L4_argument_unpacking_done:;
3252  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_base);
3253 
3254  /* function exit code */
3255  __Pyx_RefNannyFinishContext();
3256  return __pyx_r;
3257 }
3258 
3259 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base) {
3260  PyObject *__pyx_v_output_file = NULL;
3261  PyObject *__pyx_v_i = NULL;
3262  PyObject *__pyx_v_k = NULL;
3263  PyObject *__pyx_r = NULL;
3264  __Pyx_RefNannyDeclarations
3265  PyObject *__pyx_t_1 = NULL;
3266  PyObject *__pyx_t_2 = NULL;
3267  PyObject *__pyx_t_3 = NULL;
3268  PyObject *__pyx_t_4 = NULL;
3269  PyObject *__pyx_t_5 = NULL;
3270  PyObject *__pyx_t_6 = NULL;
3271  PyObject *__pyx_t_7 = NULL;
3272  PyObject *__pyx_t_8 = NULL;
3273  PyObject *__pyx_t_9 = NULL;
3274  PyObject *__pyx_t_10 = NULL;
3275  PyObject *__pyx_t_11 = NULL;
3276  Py_ssize_t __pyx_t_12;
3277  PyObject *(*__pyx_t_13)(PyObject *);
3278  Py_ssize_t __pyx_t_14;
3279  PyObject *(*__pyx_t_15)(PyObject *);
3280  PyObject *__pyx_t_16 = NULL;
3281  PyObject *__pyx_t_17 = NULL;
3282  int __pyx_t_18;
3283  int __pyx_t_19;
3284  __Pyx_RefNannySetupContext("fwrite", 0);
3285 
3286  /* "superluWrappers.pyx":56
3287  * ?!Possibly something to do with parallel?!
3288  * """
3289  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3290  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3291  * for i in range(self.nr):
3292  */
3293  /*with:*/ {
3294  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
3295  __Pyx_GOTREF(__pyx_t_1);
3296  __Pyx_INCREF(__pyx_v_filename);
3297  __Pyx_GIVEREF(__pyx_v_filename);
3298  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
3299  __Pyx_INCREF(__pyx_n_s_w);
3300  __Pyx_GIVEREF(__pyx_n_s_w);
3301  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_w);
3302  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
3303  __Pyx_GOTREF(__pyx_t_2);
3304  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3305  __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
3306  __Pyx_GOTREF(__pyx_t_3);
3307  __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L3_error)
3308  __Pyx_GOTREF(__pyx_t_4);
3309  __pyx_t_5 = NULL;
3310  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3311  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3312  if (likely(__pyx_t_5)) {
3313  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3314  __Pyx_INCREF(__pyx_t_5);
3315  __Pyx_INCREF(function);
3316  __Pyx_DECREF_SET(__pyx_t_4, function);
3317  }
3318  }
3319  if (__pyx_t_5) {
3320  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L3_error)
3321  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3322  } else {
3323  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L3_error)
3324  }
3325  __Pyx_GOTREF(__pyx_t_1);
3326  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3327  __pyx_t_4 = __pyx_t_1;
3328  __pyx_t_1 = 0;
3329  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3330  /*try:*/ {
3331  {
3332  __Pyx_PyThreadState_declare
3333  __Pyx_PyThreadState_assign
3334  __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3335  __Pyx_XGOTREF(__pyx_t_6);
3336  __Pyx_XGOTREF(__pyx_t_7);
3337  __Pyx_XGOTREF(__pyx_t_8);
3338  /*try:*/ {
3339  __pyx_v_output_file = __pyx_t_4;
3340  __pyx_t_4 = 0;
3341 
3342  /* "superluWrappers.pyx":57
3343  * """
3344  * with open(filename, 'w') as output_file:
3345  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) ) # <<<<<<<<<<<<<<
3346  * for i in range(self.nr):
3347  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3348  */
3349  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L7_error)
3350  __Pyx_GOTREF(__pyx_t_2);
3351  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L7_error)
3352  __Pyx_GOTREF(__pyx_t_1);
3353  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
3354  __Pyx_GOTREF(__pyx_t_5);
3355  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L7_error)
3356  __Pyx_GOTREF(__pyx_t_9);
3357  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3358  __Pyx_GOTREF(__pyx_t_10);
3359  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3360  __Pyx_GOTREF(__pyx_t_11);
3361  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3362  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3363  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3364  __Pyx_GOTREF(__pyx_t_10);
3365  __Pyx_GIVEREF(__pyx_t_1);
3366  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
3367  __Pyx_GIVEREF(__pyx_t_5);
3368  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3369  __Pyx_GIVEREF(__pyx_t_11);
3370  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_11);
3371  __pyx_t_1 = 0;
3372  __pyx_t_5 = 0;
3373  __pyx_t_11 = 0;
3374  __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_i_i_i, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3375  __Pyx_GOTREF(__pyx_t_11);
3376  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3377  __pyx_t_10 = NULL;
3378  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3379  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
3380  if (likely(__pyx_t_10)) {
3381  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3382  __Pyx_INCREF(__pyx_t_10);
3383  __Pyx_INCREF(function);
3384  __Pyx_DECREF_SET(__pyx_t_2, function);
3385  }
3386  }
3387  if (!__pyx_t_10) {
3388  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3389  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3390  __Pyx_GOTREF(__pyx_t_4);
3391  } else {
3392  #if CYTHON_FAST_PYCALL
3393  if (PyFunction_Check(__pyx_t_2)) {
3394  PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_11};
3395  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3396  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3397  __Pyx_GOTREF(__pyx_t_4);
3398  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3399  } else
3400  #endif
3401  #if CYTHON_FAST_PYCCALL
3402  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
3403  PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_11};
3404  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3405  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3406  __Pyx_GOTREF(__pyx_t_4);
3407  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3408  } else
3409  #endif
3410  {
3411  __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
3412  __Pyx_GOTREF(__pyx_t_5);
3413  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL;
3414  __Pyx_GIVEREF(__pyx_t_11);
3415  PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_11);
3416  __pyx_t_11 = 0;
3417  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3418  __Pyx_GOTREF(__pyx_t_4);
3419  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3420  }
3421  }
3422  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3423  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3424 
3425  /* "superluWrappers.pyx":58
3426  * with open(filename, 'w') as output_file:
3427  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3428  * for i in range(self.nr): # <<<<<<<<<<<<<<
3429  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3430  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3431  */
3432  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3433  __Pyx_GOTREF(__pyx_t_4);
3434  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3435  __Pyx_GOTREF(__pyx_t_2);
3436  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3437  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
3438  __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0;
3439  __pyx_t_13 = NULL;
3440  } else {
3441  __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3442  __Pyx_GOTREF(__pyx_t_4);
3443  __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 58, __pyx_L7_error)
3444  }
3445  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3446  for (;;) {
3447  if (likely(!__pyx_t_13)) {
3448  if (likely(PyList_CheckExact(__pyx_t_4))) {
3449  if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break;
3450  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3451  __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3452  #else
3453  __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3454  __Pyx_GOTREF(__pyx_t_2);
3455  #endif
3456  } else {
3457  if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
3458  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3459  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3460  #else
3461  __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3462  __Pyx_GOTREF(__pyx_t_2);
3463  #endif
3464  }
3465  } else {
3466  __pyx_t_2 = __pyx_t_13(__pyx_t_4);
3467  if (unlikely(!__pyx_t_2)) {
3468  PyObject* exc_type = PyErr_Occurred();
3469  if (exc_type) {
3470  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3471  else __PYX_ERR(0, 58, __pyx_L7_error)
3472  }
3473  break;
3474  }
3475  __Pyx_GOTREF(__pyx_t_2);
3476  }
3477  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
3478  __pyx_t_2 = 0;
3479 
3480  /* "superluWrappers.pyx":59
3481  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3482  * for i in range(self.nr):
3483  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3484  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3485  *
3486  */
3487  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3488  __Pyx_GOTREF(__pyx_t_2);
3489  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3490  __Pyx_GOTREF(__pyx_t_5);
3491  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3492  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3493  __Pyx_GOTREF(__pyx_t_2);
3494  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3495  __Pyx_GOTREF(__pyx_t_11);
3496  __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3497  __Pyx_GOTREF(__pyx_t_10);
3498  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3499  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3500  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3501  __Pyx_GOTREF(__pyx_t_11);
3502  __Pyx_GIVEREF(__pyx_t_5);
3503  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5);
3504  __Pyx_GIVEREF(__pyx_t_10);
3505  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
3506  __pyx_t_5 = 0;
3507  __pyx_t_10 = 0;
3508  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3509  __Pyx_GOTREF(__pyx_t_10);
3510  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3511  if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
3512  __pyx_t_11 = __pyx_t_10; __Pyx_INCREF(__pyx_t_11); __pyx_t_14 = 0;
3513  __pyx_t_15 = NULL;
3514  } else {
3515  __pyx_t_14 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3516  __Pyx_GOTREF(__pyx_t_11);
3517  __pyx_t_15 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 59, __pyx_L7_error)
3518  }
3519  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3520  for (;;) {
3521  if (likely(!__pyx_t_15)) {
3522  if (likely(PyList_CheckExact(__pyx_t_11))) {
3523  if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_11)) break;
3524  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3525  __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3526  #else
3527  __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3528  __Pyx_GOTREF(__pyx_t_10);
3529  #endif
3530  } else {
3531  if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
3532  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3533  __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3534  #else
3535  __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3536  __Pyx_GOTREF(__pyx_t_10);
3537  #endif
3538  }
3539  } else {
3540  __pyx_t_10 = __pyx_t_15(__pyx_t_11);
3541  if (unlikely(!__pyx_t_10)) {
3542  PyObject* exc_type = PyErr_Occurred();
3543  if (exc_type) {
3544  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3545  else __PYX_ERR(0, 59, __pyx_L7_error)
3546  }
3547  break;
3548  }
3549  __Pyx_GOTREF(__pyx_t_10);
3550  }
3551  __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_10);
3552  __pyx_t_10 = 0;
3553 
3554  /* "superluWrappers.pyx":60
3555  * for i in range(self.nr):
3556  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3557  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) ) # <<<<<<<<<<<<<<
3558  *
3559  * def getCSRrepresentation(self):
3560  */
3561  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L7_error)
3562  __Pyx_GOTREF(__pyx_t_5);
3563  __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_v_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
3564  __Pyx_GOTREF(__pyx_t_2);
3565  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3566  __Pyx_GOTREF(__pyx_t_1);
3567  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_k); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3568  __Pyx_GOTREF(__pyx_t_9);
3569  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3570  __pyx_t_1 = PyNumber_Add(__pyx_t_9, __pyx_v_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3571  __Pyx_GOTREF(__pyx_t_1);
3572  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3573  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3574  __Pyx_GOTREF(__pyx_t_9);
3575  __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3576  __Pyx_GOTREF(__pyx_t_16);
3577  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3578  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3579  __Pyx_GOTREF(__pyx_t_9);
3580  __Pyx_GIVEREF(__pyx_t_2);
3581  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
3582  __Pyx_GIVEREF(__pyx_t_1);
3583  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
3584  __Pyx_GIVEREF(__pyx_t_16);
3585  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_16);
3586  __pyx_t_2 = 0;
3587  __pyx_t_1 = 0;
3588  __pyx_t_16 = 0;
3589  __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_d_d_13_8e, __pyx_t_9); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3590  __Pyx_GOTREF(__pyx_t_16);
3591  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3592  __pyx_t_9 = NULL;
3593  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
3594  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
3595  if (likely(__pyx_t_9)) {
3596  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3597  __Pyx_INCREF(__pyx_t_9);
3598  __Pyx_INCREF(function);
3599  __Pyx_DECREF_SET(__pyx_t_5, function);
3600  }
3601  }
3602  if (!__pyx_t_9) {
3603  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_16); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L7_error)
3604  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3605  __Pyx_GOTREF(__pyx_t_10);
3606  } else {
3607  #if CYTHON_FAST_PYCALL
3608  if (PyFunction_Check(__pyx_t_5)) {
3609  PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_16};
3610  __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L7_error)
3611  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3612  __Pyx_GOTREF(__pyx_t_10);
3613  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3614  } else
3615  #endif
3616  #if CYTHON_FAST_PYCCALL
3617  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
3618  PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_16};
3619  __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L7_error)
3620  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3621  __Pyx_GOTREF(__pyx_t_10);
3622  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3623  } else
3624  #endif
3625  {
3626  __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3627  __Pyx_GOTREF(__pyx_t_1);
3628  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL;
3629  __Pyx_GIVEREF(__pyx_t_16);
3630  PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_16);
3631  __pyx_t_16 = 0;
3632  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L7_error)
3633  __Pyx_GOTREF(__pyx_t_10);
3634  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3635  }
3636  }
3637  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3638  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3639 
3640  /* "superluWrappers.pyx":59
3641  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3642  * for i in range(self.nr):
3643  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3644  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3645  *
3646  */
3647  }
3648  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3649 
3650  /* "superluWrappers.pyx":58
3651  * with open(filename, 'w') as output_file:
3652  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3653  * for i in range(self.nr): # <<<<<<<<<<<<<<
3654  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3655  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3656  */
3657  }
3658  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3659 
3660  /* "superluWrappers.pyx":56
3661  * ?!Possibly something to do with parallel?!
3662  * """
3663  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3664  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3665  * for i in range(self.nr):
3666  */
3667  }
3668  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3669  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3670  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3671  goto __pyx_L12_try_end;
3672  __pyx_L7_error:;
3673  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3674  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3675  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3676  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3677  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3678  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3679  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
3680  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3681  /*except:*/ {
3682  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3683  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_10) < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3684  __Pyx_GOTREF(__pyx_t_4);
3685  __Pyx_GOTREF(__pyx_t_11);
3686  __Pyx_GOTREF(__pyx_t_10);
3687  __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3688  __Pyx_GOTREF(__pyx_t_5);
3689  __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
3690  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3691  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3692  if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3693  __Pyx_GOTREF(__pyx_t_17);
3694  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_17);
3695  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3696  if (__pyx_t_18 < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3697  __pyx_t_19 = ((!(__pyx_t_18 != 0)) != 0);
3698  if (__pyx_t_19) {
3699  __Pyx_GIVEREF(__pyx_t_4);
3700  __Pyx_GIVEREF(__pyx_t_11);
3701  __Pyx_XGIVEREF(__pyx_t_10);
3702  __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_11, __pyx_t_10);
3703  __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0;
3704  __PYX_ERR(0, 56, __pyx_L9_except_error)
3705  }
3706  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3707  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3708  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3709  goto __pyx_L8_exception_handled;
3710  }
3711  __pyx_L9_except_error:;
3712  __Pyx_XGIVEREF(__pyx_t_6);
3713  __Pyx_XGIVEREF(__pyx_t_7);
3714  __Pyx_XGIVEREF(__pyx_t_8);
3715  __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3716  goto __pyx_L1_error;
3717  __pyx_L8_exception_handled:;
3718  __Pyx_XGIVEREF(__pyx_t_6);
3719  __Pyx_XGIVEREF(__pyx_t_7);
3720  __Pyx_XGIVEREF(__pyx_t_8);
3721  __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3722  __pyx_L12_try_end:;
3723  }
3724  }
3725  /*finally:*/ {
3726  /*normal exit:*/{
3727  if (__pyx_t_3) {
3728  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL);
3729  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3730  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error)
3731  __Pyx_GOTREF(__pyx_t_8);
3732  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3733  }
3734  goto __pyx_L6;
3735  }
3736  __pyx_L6:;
3737  }
3738  goto __pyx_L20;
3739  __pyx_L3_error:;
3740  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3741  goto __pyx_L1_error;
3742  __pyx_L20:;
3743  }
3744 
3745  /* "superluWrappers.pyx":46
3746  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3747  *
3748  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3749  * """ Write the sparse matrix to a file
3750  *
3751  */
3752 
3753  /* function exit code */
3754  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3755  goto __pyx_L0;
3756  __pyx_L1_error:;
3757  __Pyx_XDECREF(__pyx_t_1);
3758  __Pyx_XDECREF(__pyx_t_2);
3759  __Pyx_XDECREF(__pyx_t_4);
3760  __Pyx_XDECREF(__pyx_t_5);
3761  __Pyx_XDECREF(__pyx_t_9);
3762  __Pyx_XDECREF(__pyx_t_10);
3763  __Pyx_XDECREF(__pyx_t_11);
3764  __Pyx_XDECREF(__pyx_t_16);
3765  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3766  __pyx_r = NULL;
3767  __pyx_L0:;
3768  __Pyx_XDECREF(__pyx_v_output_file);
3769  __Pyx_XDECREF(__pyx_v_i);
3770  __Pyx_XDECREF(__pyx_v_k);
3771  __Pyx_XGIVEREF(__pyx_r);
3772  __Pyx_RefNannyFinishContext();
3773  return __pyx_r;
3774 }
3775 
3776 /* "superluWrappers.pyx":62
3777  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3778  *
3779  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
3780  * """ Get the CSR representation of the sparse matrix.
3781  *
3782  */
3783 
3784 /* Python wrapper */
3785 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3786 static char __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation[] = " Get the CSR representation of the sparse matrix.\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colptr, vals)\n ";
3787 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation = {"getCSRrepresentation", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation, METH_O, __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation};
3788 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3789  PyObject *__pyx_r = 0;
3790  __Pyx_RefNannyDeclarations
3791  __Pyx_RefNannySetupContext("getCSRrepresentation (wrapper)", 0);
3792  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(__pyx_self, ((PyObject *)__pyx_v_self));
3793 
3794  /* function exit code */
3795  __Pyx_RefNannyFinishContext();
3796  return __pyx_r;
3797 }
3798 
3799 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
3800  PyObject *__pyx_r = NULL;
3801  __Pyx_RefNannyDeclarations
3802  PyObject *__pyx_t_1 = NULL;
3803  PyObject *__pyx_t_2 = NULL;
3804  PyObject *__pyx_t_3 = NULL;
3805  PyObject *__pyx_t_4 = NULL;
3806  __Pyx_RefNannySetupContext("getCSRrepresentation", 0);
3807 
3808  /* "superluWrappers.pyx":70
3809  * (rowptr, colptr, vals)
3810  * """
3811  * return (self.rowptr, self.colind, self.nzvals) # <<<<<<<<<<<<<<
3812  *
3813  * def getSubMatCSRrepresentation(self,
3814  */
3815  __Pyx_XDECREF(__pyx_r);
3816  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
3817  __Pyx_GOTREF(__pyx_t_1);
3818  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
3819  __Pyx_GOTREF(__pyx_t_2);
3820  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
3821  __Pyx_GOTREF(__pyx_t_3);
3822  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
3823  __Pyx_GOTREF(__pyx_t_4);
3824  __Pyx_GIVEREF(__pyx_t_1);
3825  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3826  __Pyx_GIVEREF(__pyx_t_2);
3827  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
3828  __Pyx_GIVEREF(__pyx_t_3);
3829  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
3830  __pyx_t_1 = 0;
3831  __pyx_t_2 = 0;
3832  __pyx_t_3 = 0;
3833  __pyx_r = __pyx_t_4;
3834  __pyx_t_4 = 0;
3835  goto __pyx_L0;
3836 
3837  /* "superluWrappers.pyx":62
3838  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3839  *
3840  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
3841  * """ Get the CSR representation of the sparse matrix.
3842  *
3843  */
3844 
3845  /* function exit code */
3846  __pyx_L1_error:;
3847  __Pyx_XDECREF(__pyx_t_1);
3848  __Pyx_XDECREF(__pyx_t_2);
3849  __Pyx_XDECREF(__pyx_t_3);
3850  __Pyx_XDECREF(__pyx_t_4);
3851  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
3852  __pyx_r = NULL;
3853  __pyx_L0:;
3854  __Pyx_XGIVEREF(__pyx_r);
3855  __Pyx_RefNannyFinishContext();
3856  return __pyx_r;
3857 }
3858 
3859 /* "superluWrappers.pyx":72
3860  * return (self.rowptr, self.colind, self.nzvals)
3861  *
3862  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
3863  * range_start,
3864  * range_end):
3865  */
3866 
3867 /* Python wrapper */
3868 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3869 static char __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation[] = " Get the CSR representation for a submatrix.\n\n Arguments\n ---------\n range_start : int\n range_end : int\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colind, nzvals)\n ";
3870 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation = {"getSubMatCSRrepresentation", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation};
3871 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3872  PyObject *__pyx_v_self = 0;
3873  PyObject *__pyx_v_range_start = 0;
3874  PyObject *__pyx_v_range_end = 0;
3875  PyObject *__pyx_r = 0;
3876  __Pyx_RefNannyDeclarations
3877  __Pyx_RefNannySetupContext("getSubMatCSRrepresentation (wrapper)", 0);
3878  {
3879  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_range_start,&__pyx_n_s_range_end,0};
3880  PyObject* values[3] = {0,0,0};
3881  if (unlikely(__pyx_kwds)) {
3882  Py_ssize_t kw_args;
3883  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3884  switch (pos_args) {
3885  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3886  CYTHON_FALLTHROUGH;
3887  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3888  CYTHON_FALLTHROUGH;
3889  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3890  CYTHON_FALLTHROUGH;
3891  case 0: break;
3892  default: goto __pyx_L5_argtuple_error;
3893  }
3894  kw_args = PyDict_Size(__pyx_kwds);
3895  switch (pos_args) {
3896  case 0:
3897  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3898  else goto __pyx_L5_argtuple_error;
3899  CYTHON_FALLTHROUGH;
3900  case 1:
3901  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_start)) != 0)) kw_args--;
3902  else {
3903  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 1); __PYX_ERR(0, 72, __pyx_L3_error)
3904  }
3905  CYTHON_FALLTHROUGH;
3906  case 2:
3907  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_end)) != 0)) kw_args--;
3908  else {
3909  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 2); __PYX_ERR(0, 72, __pyx_L3_error)
3910  }
3911  }
3912  if (unlikely(kw_args > 0)) {
3913  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSubMatCSRrepresentation") < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
3914  }
3915  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3916  goto __pyx_L5_argtuple_error;
3917  } else {
3918  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3919  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3920  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3921  }
3922  __pyx_v_self = values[0];
3923  __pyx_v_range_start = values[1];
3924  __pyx_v_range_end = values[2];
3925  }
3926  goto __pyx_L4_argument_unpacking_done;
3927  __pyx_L5_argtuple_error:;
3928  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error)
3929  __pyx_L3_error:;
3930  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
3931  __Pyx_RefNannyFinishContext();
3932  return NULL;
3933  __pyx_L4_argument_unpacking_done:;
3934  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(__pyx_self, __pyx_v_self, __pyx_v_range_start, __pyx_v_range_end);
3935 
3936  /* function exit code */
3937  __Pyx_RefNannyFinishContext();
3938  return __pyx_r;
3939 }
3940 
3941 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end) {
3942  PyObject *__pyx_v__rows = NULL;
3943  PyObject *__pyx_v_nnz = NULL;
3944  PyObject *__pyx_v_rowptr = NULL;
3945  PyObject *__pyx_v_colind = NULL;
3946  PyObject *__pyx_v_nzvals = NULL;
3947  PyObject *__pyx_r = NULL;
3948  __Pyx_RefNannyDeclarations
3949  PyObject *__pyx_t_1 = NULL;
3950  int __pyx_t_2;
3951  PyObject *__pyx_t_3 = NULL;
3952  PyObject *__pyx_t_4 = NULL;
3953  PyObject *__pyx_t_5 = NULL;
3954  __Pyx_RefNannySetupContext("getSubMatCSRrepresentation", 0);
3955 
3956  /* "superluWrappers.pyx":87
3957  * (rowptr, colind, nzvals)
3958  * """
3959  * assert range_start >= 0 ; assert range_end <= self.nr # <<<<<<<<<<<<<<
3960  * assert range_end > range_start
3961  * _rows = range_end - range_start
3962  */
3963  #ifndef CYTHON_WITHOUT_ASSERTIONS
3964  if (unlikely(!Py_OptimizeFlag)) {
3965  __pyx_t_1 = PyObject_RichCompare(__pyx_v_range_start, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
3966  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
3967  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3968  if (unlikely(!__pyx_t_2)) {
3969  PyErr_SetNone(PyExc_AssertionError);
3970  __PYX_ERR(0, 87, __pyx_L1_error)
3971  }
3972  }
3973  #endif
3974  #ifndef CYTHON_WITHOUT_ASSERTIONS
3975  if (unlikely(!Py_OptimizeFlag)) {
3976  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
3977  __Pyx_GOTREF(__pyx_t_1);
3978  __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
3979  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3980  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
3981  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3982  if (unlikely(!__pyx_t_2)) {
3983  PyErr_SetNone(PyExc_AssertionError);
3984  __PYX_ERR(0, 87, __pyx_L1_error)
3985  }
3986  }
3987  #endif
3988 
3989  /* "superluWrappers.pyx":88
3990  * """
3991  * assert range_start >= 0 ; assert range_end <= self.nr
3992  * assert range_end > range_start # <<<<<<<<<<<<<<
3993  * _rows = range_end - range_start
3994  * assert _rows <= self.nr
3995  */
3996  #ifndef CYTHON_WITHOUT_ASSERTIONS
3997  if (unlikely(!Py_OptimizeFlag)) {
3998  __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_v_range_start, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
3999  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 88, __pyx_L1_error)
4000  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4001  if (unlikely(!__pyx_t_2)) {
4002  PyErr_SetNone(PyExc_AssertionError);
4003  __PYX_ERR(0, 88, __pyx_L1_error)
4004  }
4005  }
4006  #endif
4007 
4008  /* "superluWrappers.pyx":89
4009  * assert range_start >= 0 ; assert range_end <= self.nr
4010  * assert range_end > range_start
4011  * _rows = range_end - range_start # <<<<<<<<<<<<<<
4012  * assert _rows <= self.nr
4013  *
4014  */
4015  __pyx_t_3 = PyNumber_Subtract(__pyx_v_range_end, __pyx_v_range_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
4016  __Pyx_GOTREF(__pyx_t_3);
4017  __pyx_v__rows = __pyx_t_3;
4018  __pyx_t_3 = 0;
4019 
4020  /* "superluWrappers.pyx":90
4021  * assert range_end > range_start
4022  * _rows = range_end - range_start
4023  * assert _rows <= self.nr # <<<<<<<<<<<<<<
4024  *
4025  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4026  */
4027  #ifndef CYTHON_WITHOUT_ASSERTIONS
4028  if (unlikely(!Py_OptimizeFlag)) {
4029  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
4030  __Pyx_GOTREF(__pyx_t_3);
4031  __pyx_t_1 = PyObject_RichCompare(__pyx_v__rows, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
4032  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4033  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
4034  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4035  if (unlikely(!__pyx_t_2)) {
4036  PyErr_SetNone(PyExc_AssertionError);
4037  __PYX_ERR(0, 90, __pyx_L1_error)
4038  }
4039  }
4040  #endif
4041 
4042  /* "superluWrappers.pyx":92
4043  * assert _rows <= self.nr
4044  *
4045  * nnz = self.rowptr[range_end] - self.rowptr[range_start] # <<<<<<<<<<<<<<
4046  *
4047  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4048  */
4049  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4050  __Pyx_GOTREF(__pyx_t_1);
4051  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
4052  __Pyx_GOTREF(__pyx_t_3);
4053  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4054  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4055  __Pyx_GOTREF(__pyx_t_1);
4056  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
4057  __Pyx_GOTREF(__pyx_t_4);
4058  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4059  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4060  __Pyx_GOTREF(__pyx_t_1);
4061  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4062  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4063  __pyx_v_nnz = __pyx_t_1;
4064  __pyx_t_1 = 0;
4065 
4066  /* "superluWrappers.pyx":94
4067  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4068  *
4069  * rowptr = self.rowptr[range_start : range_start + _rows + 1] # <<<<<<<<<<<<<<
4070  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4071  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4072  */
4073  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4074  __Pyx_GOTREF(__pyx_t_1);
4075  __pyx_t_4 = PyNumber_Add(__pyx_v_range_start, __pyx_v__rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4076  __Pyx_GOTREF(__pyx_t_4);
4077  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
4078  __Pyx_GOTREF(__pyx_t_3);
4079  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4080  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, &__pyx_v_range_start, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4081  __Pyx_GOTREF(__pyx_t_4);
4082  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4083  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4084  __pyx_v_rowptr = __pyx_t_4;
4085  __pyx_t_4 = 0;
4086 
4087  /* "superluWrappers.pyx":95
4088  *
4089  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4090  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4091  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4092  *
4093  */
4094  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
4095  __Pyx_GOTREF(__pyx_t_4);
4096  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4097  __Pyx_GOTREF(__pyx_t_3);
4098  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
4099  __Pyx_GOTREF(__pyx_t_1);
4100  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4101  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4102  __Pyx_GOTREF(__pyx_t_3);
4103  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4104  __Pyx_GOTREF(__pyx_t_5);
4105  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4106  __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4107  __Pyx_GOTREF(__pyx_t_3);
4108  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4109  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4110  __Pyx_GOTREF(__pyx_t_5);
4111  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4112  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4113  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4114  __pyx_v_colind = __pyx_t_5;
4115  __pyx_t_5 = 0;
4116 
4117  /* "superluWrappers.pyx":96
4118  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4119  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4120  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4121  *
4122  * return rowptr, colind, nzvals
4123  */
4124  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
4125  __Pyx_GOTREF(__pyx_t_5);
4126  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4127  __Pyx_GOTREF(__pyx_t_3);
4128  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
4129  __Pyx_GOTREF(__pyx_t_1);
4130  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4131  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4132  __Pyx_GOTREF(__pyx_t_3);
4133  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4134  __Pyx_GOTREF(__pyx_t_4);
4135  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4136  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4137  __Pyx_GOTREF(__pyx_t_3);
4138  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4139  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4140  __Pyx_GOTREF(__pyx_t_4);
4141  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4142  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4143  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4144  __pyx_v_nzvals = __pyx_t_4;
4145  __pyx_t_4 = 0;
4146 
4147  /* "superluWrappers.pyx":98
4148  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4149  *
4150  * return rowptr, colind, nzvals # <<<<<<<<<<<<<<
4151  *
4152  * cdef class cSparseMatrix(object):
4153  */
4154  __Pyx_XDECREF(__pyx_r);
4155  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
4156  __Pyx_GOTREF(__pyx_t_4);
4157  __Pyx_INCREF(__pyx_v_rowptr);
4158  __Pyx_GIVEREF(__pyx_v_rowptr);
4159  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rowptr);
4160  __Pyx_INCREF(__pyx_v_colind);
4161  __Pyx_GIVEREF(__pyx_v_colind);
4162  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_colind);
4163  __Pyx_INCREF(__pyx_v_nzvals);
4164  __Pyx_GIVEREF(__pyx_v_nzvals);
4165  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nzvals);
4166  __pyx_r = __pyx_t_4;
4167  __pyx_t_4 = 0;
4168  goto __pyx_L0;
4169 
4170  /* "superluWrappers.pyx":72
4171  * return (self.rowptr, self.colind, self.nzvals)
4172  *
4173  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
4174  * range_start,
4175  * range_end):
4176  */
4177 
4178  /* function exit code */
4179  __pyx_L1_error:;
4180  __Pyx_XDECREF(__pyx_t_1);
4181  __Pyx_XDECREF(__pyx_t_3);
4182  __Pyx_XDECREF(__pyx_t_4);
4183  __Pyx_XDECREF(__pyx_t_5);
4184  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4185  __pyx_r = NULL;
4186  __pyx_L0:;
4187  __Pyx_XDECREF(__pyx_v__rows);
4188  __Pyx_XDECREF(__pyx_v_nnz);
4189  __Pyx_XDECREF(__pyx_v_rowptr);
4190  __Pyx_XDECREF(__pyx_v_colind);
4191  __Pyx_XDECREF(__pyx_v_nzvals);
4192  __Pyx_XGIVEREF(__pyx_r);
4193  __Pyx_RefNannyFinishContext();
4194  return __pyx_r;
4195 }
4196 
4197 /* "superluWrappers.pyx":102
4198  * cdef class cSparseMatrix(object):
4199  *
4200  * def __cinit__(self, # <<<<<<<<<<<<<<
4201  * int nr,
4202  * int nc,
4203  */
4204 
4205 /* Python wrapper */
4206 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4207 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4208  int __pyx_v_nr;
4209  int __pyx_v_nc;
4210  int __pyx_v_nnz;
4211  __Pyx_memviewslice __pyx_v_nzval = { 0, 0, { 0 }, { 0 }, { 0 } };
4212  __Pyx_memviewslice __pyx_v_colind = { 0, 0, { 0 }, { 0 }, { 0 } };
4213  __Pyx_memviewslice __pyx_v_rowptr = { 0, 0, { 0 }, { 0 }, { 0 } };
4214  int __pyx_r;
4215  __Pyx_RefNannyDeclarations
4216  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4217  {
4218  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzval,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
4219  PyObject* values[6] = {0,0,0,0,0,0};
4220  if (unlikely(__pyx_kwds)) {
4221  Py_ssize_t kw_args;
4222  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4223  switch (pos_args) {
4224  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4225  CYTHON_FALLTHROUGH;
4226  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4227  CYTHON_FALLTHROUGH;
4228  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4229  CYTHON_FALLTHROUGH;
4230  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4231  CYTHON_FALLTHROUGH;
4232  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4233  CYTHON_FALLTHROUGH;
4234  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4235  CYTHON_FALLTHROUGH;
4236  case 0: break;
4237  default: goto __pyx_L5_argtuple_error;
4238  }
4239  kw_args = PyDict_Size(__pyx_kwds);
4240  switch (pos_args) {
4241  case 0:
4242  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
4243  else goto __pyx_L5_argtuple_error;
4244  CYTHON_FALLTHROUGH;
4245  case 1:
4246  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
4247  else {
4248  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4249  }
4250  CYTHON_FALLTHROUGH;
4251  case 2:
4252  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
4253  else {
4254  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(0, 102, __pyx_L3_error)
4255  }
4256  CYTHON_FALLTHROUGH;
4257  case 3:
4258  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzval)) != 0)) kw_args--;
4259  else {
4260  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(0, 102, __pyx_L3_error)
4261  }
4262  CYTHON_FALLTHROUGH;
4263  case 4:
4264  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
4265  else {
4266  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(0, 102, __pyx_L3_error)
4267  }
4268  CYTHON_FALLTHROUGH;
4269  case 5:
4270  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
4271  else {
4272  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(0, 102, __pyx_L3_error)
4273  }
4274  }
4275  if (unlikely(kw_args > 0)) {
4276  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
4277  }
4278  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4279  goto __pyx_L5_argtuple_error;
4280  } else {
4281  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4282  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4283  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4284  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4285  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4286  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4287  }
4288  __pyx_v_nr = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_nr == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
4289  __pyx_v_nc = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
4290  __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error)
4291  __pyx_v_nzval = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nzval.memview)) __PYX_ERR(0, 106, __pyx_L3_error)
4292  __pyx_v_colind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_colind.memview)) __PYX_ERR(0, 107, __pyx_L3_error)
4293  __pyx_v_rowptr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_rowptr.memview)) __PYX_ERR(0, 108, __pyx_L3_error)
4294  }
4295  goto __pyx_L4_argument_unpacking_done;
4296  __pyx_L5_argtuple_error:;
4297  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
4298  __pyx_L3_error:;
4299  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4300  __Pyx_RefNannyFinishContext();
4301  return -1;
4302  __pyx_L4_argument_unpacking_done:;
4303  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzval, __pyx_v_colind, __pyx_v_rowptr);
4304 
4305  /* function exit code */
4306  __Pyx_RefNannyFinishContext();
4307  return __pyx_r;
4308 }
4309 
4310 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr) {
4311  int __pyx_r;
4312  __Pyx_RefNannyDeclarations
4313  Py_ssize_t __pyx_t_1;
4314  Py_ssize_t __pyx_t_2;
4315  Py_ssize_t __pyx_t_3;
4316  __Pyx_RefNannySetupContext("__cinit__", 0);
4317 
4318  /* "superluWrappers.pyx":109
4319  * np.int32_t [:] colind,
4320  * np.int32_t [:] rowptr):
4321  * self.dim[0] = nr ; self.dim[1] = nc # <<<<<<<<<<<<<<
4322  * self.A.nnz = nnz
4323  * #ARB - should memory for these ptrs need be allocated?
4324  */
4325  (__pyx_v_self->dim[0]) = __pyx_v_nr;
4326  (__pyx_v_self->dim[1]) = __pyx_v_nc;
4327 
4328  /* "superluWrappers.pyx":110
4329  * np.int32_t [:] rowptr):
4330  * self.dim[0] = nr ; self.dim[1] = nc
4331  * self.A.nnz = nnz # <<<<<<<<<<<<<<
4332  * #ARB - should memory for these ptrs need be allocated?
4333  * self.A.nzval = &nzval[0]
4334  */
4335  __pyx_v_self->A.nnz = __pyx_v_nnz;
4336 
4337  /* "superluWrappers.pyx":112
4338  * self.A.nnz = nnz
4339  * #ARB - should memory for these ptrs need be allocated?
4340  * self.A.nzval = &nzval[0] # <<<<<<<<<<<<<<
4341  * self.A.colind = &colind[0]
4342  * self.A.rowptr = &rowptr[0]
4343  */
4344  __pyx_t_1 = 0;
4345  __pyx_v_self->A.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_nzval.data + __pyx_t_1 * __pyx_v_nzval.strides[0]) ))));
4346 
4347  /* "superluWrappers.pyx":113
4348  * #ARB - should memory for these ptrs need be allocated?
4349  * self.A.nzval = &nzval[0]
4350  * self.A.colind = &colind[0] # <<<<<<<<<<<<<<
4351  * self.A.rowptr = &rowptr[0]
4352  *
4353  */
4354  __pyx_t_2 = 0;
4355  __pyx_v_self->A.colind = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_colind.data + __pyx_t_2 * __pyx_v_colind.strides[0]) ))));
4356 
4357  /* "superluWrappers.pyx":114
4358  * self.A.nzval = &nzval[0]
4359  * self.A.colind = &colind[0]
4360  * self.A.rowptr = &rowptr[0] # <<<<<<<<<<<<<<
4361  *
4362  * cdef void SparseMatrix_matvec(cSparseMatrix sm,
4363  */
4364  __pyx_t_3 = 0;
4365  __pyx_v_self->A.rowptr = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_rowptr.data + __pyx_t_3 * __pyx_v_rowptr.strides[0]) ))));
4366 
4367  /* "superluWrappers.pyx":102
4368  * cdef class cSparseMatrix(object):
4369  *
4370  * def __cinit__(self, # <<<<<<<<<<<<<<
4371  * int nr,
4372  * int nc,
4373  */
4374 
4375  /* function exit code */
4376  __pyx_r = 0;
4377  __PYX_XDEC_MEMVIEW(&__pyx_v_nzval, 1);
4378  __PYX_XDEC_MEMVIEW(&__pyx_v_colind, 1);
4379  __PYX_XDEC_MEMVIEW(&__pyx_v_rowptr, 1);
4380  __Pyx_RefNannyFinishContext();
4381  return __pyx_r;
4382 }
4383 
4384 /* "(tree fragment)":1
4385  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4386  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4387  * def __setstate_cython__(self, __pyx_state):
4388  */
4389 
4390 /* Python wrapper */
4391 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4392 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4393  PyObject *__pyx_r = 0;
4394  __Pyx_RefNannyDeclarations
4395  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4396  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self));
4397 
4398  /* function exit code */
4399  __Pyx_RefNannyFinishContext();
4400  return __pyx_r;
4401 }
4402 
4403 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self) {
4404  PyObject *__pyx_r = NULL;
4405  __Pyx_RefNannyDeclarations
4406  PyObject *__pyx_t_1 = NULL;
4407  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4408 
4409  /* "(tree fragment)":2
4410  * def __reduce_cython__(self):
4411  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4412  * def __setstate_cython__(self, __pyx_state):
4413  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4414  */
4415  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4416  __Pyx_GOTREF(__pyx_t_1);
4417  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4418  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4419  __PYX_ERR(1, 2, __pyx_L1_error)
4420 
4421  /* "(tree fragment)":1
4422  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4423  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4424  * def __setstate_cython__(self, __pyx_state):
4425  */
4426 
4427  /* function exit code */
4428  __pyx_L1_error:;
4429  __Pyx_XDECREF(__pyx_t_1);
4430  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4431  __pyx_r = NULL;
4432  __Pyx_XGIVEREF(__pyx_r);
4433  __Pyx_RefNannyFinishContext();
4434  return __pyx_r;
4435 }
4436 
4437 /* "(tree fragment)":3
4438  * def __reduce_cython__(self):
4439  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4440  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4441  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4442  */
4443 
4444 /* Python wrapper */
4445 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4446 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4447  PyObject *__pyx_r = 0;
4448  __Pyx_RefNannyDeclarations
4449  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4450  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4451 
4452  /* function exit code */
4453  __Pyx_RefNannyFinishContext();
4454  return __pyx_r;
4455 }
4456 
4457 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4458  PyObject *__pyx_r = NULL;
4459  __Pyx_RefNannyDeclarations
4460  PyObject *__pyx_t_1 = NULL;
4461  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4462 
4463  /* "(tree fragment)":4
4464  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4465  * def __setstate_cython__(self, __pyx_state):
4466  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4467  */
4468  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4469  __Pyx_GOTREF(__pyx_t_1);
4470  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4471  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4472  __PYX_ERR(1, 4, __pyx_L1_error)
4473 
4474  /* "(tree fragment)":3
4475  * def __reduce_cython__(self):
4476  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4477  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4478  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4479  */
4480 
4481  /* function exit code */
4482  __pyx_L1_error:;
4483  __Pyx_XDECREF(__pyx_t_1);
4484  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4485  __pyx_r = NULL;
4486  __Pyx_XGIVEREF(__pyx_r);
4487  __Pyx_RefNannyFinishContext();
4488  return __pyx_r;
4489 }
4490 
4491 /* "superluWrappers.pyx":116
4492  * self.A.rowptr = &rowptr[0]
4493  *
4494  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4495  * np.float64_t [:] xp,
4496  * np.float64_t [:] yp):
4497  */
4498 
4499 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, __Pyx_memviewslice __pyx_v_xp, __Pyx_memviewslice __pyx_v_yp) {
4500  __pyx_t_5numpy_float64_t __pyx_v_tmp;
4501  int __pyx_v_i;
4502  int __pyx_v_k;
4503  __Pyx_RefNannyDeclarations
4504  __pyx_t_5numpy_int32_t __pyx_t_1;
4505  __pyx_t_5numpy_int32_t __pyx_t_2;
4506  int __pyx_t_3;
4507  __pyx_t_5numpy_int32_t __pyx_t_4;
4508  __pyx_t_5numpy_int32_t __pyx_t_5;
4509  int __pyx_t_6;
4510  Py_ssize_t __pyx_t_7;
4511  Py_ssize_t __pyx_t_8;
4512  __Pyx_RefNannySetupContext("SparseMatrix_matvec", 0);
4513 
4514  /* "superluWrappers.pyx":119
4515  * np.float64_t [:] xp,
4516  * np.float64_t [:] yp):
4517  * cdef np.float64_t tmp = 0. # <<<<<<<<<<<<<<
4518  * cdef int i, k
4519  *
4520  */
4521  __pyx_v_tmp = 0.;
4522 
4523  /* "superluWrappers.pyx":122
4524  * cdef int i, k
4525  *
4526  * for i in range(sm.dim[0]): # <<<<<<<<<<<<<<
4527  * tmp = 0.
4528  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4529  */
4530  __pyx_t_1 = (__pyx_v_sm->dim[0]);
4531  __pyx_t_2 = __pyx_t_1;
4532  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4533  __pyx_v_i = __pyx_t_3;
4534 
4535  /* "superluWrappers.pyx":123
4536  *
4537  * for i in range(sm.dim[0]):
4538  * tmp = 0. # <<<<<<<<<<<<<<
4539  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4540  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4541  */
4542  __pyx_v_tmp = 0.;
4543 
4544  /* "superluWrappers.pyx":124
4545  * for i in range(sm.dim[0]):
4546  * tmp = 0.
4547  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]): # <<<<<<<<<<<<<<
4548  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4549  * yp[i] = tmp
4550  */
4551  __pyx_t_4 = (__pyx_v_sm->A.rowptr[(__pyx_v_i + 1)]);
4552  __pyx_t_5 = __pyx_t_4;
4553  for (__pyx_t_6 = (__pyx_v_sm->A.rowptr[__pyx_v_i]); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4554  __pyx_v_k = __pyx_t_6;
4555 
4556  /* "superluWrappers.pyx":125
4557  * tmp = 0.
4558  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4559  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]] # <<<<<<<<<<<<<<
4560  * yp[i] = tmp
4561  *
4562  */
4563  __pyx_t_7 = (__pyx_v_sm->A.colind[__pyx_v_k]);
4564  __pyx_v_tmp = (__pyx_v_tmp + ((__pyx_v_sm->A.nzval[__pyx_v_k]) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_xp.data + __pyx_t_7 * __pyx_v_xp.strides[0]) )))));
4565  }
4566 
4567  /* "superluWrappers.pyx":126
4568  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4569  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4570  * yp[i] = tmp # <<<<<<<<<<<<<<
4571  *
4572  * cdef struct _NCformat:
4573  */
4574  __pyx_t_8 = __pyx_v_i;
4575  *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_yp.data + __pyx_t_8 * __pyx_v_yp.strides[0]) )) = __pyx_v_tmp;
4576  }
4577 
4578  /* "superluWrappers.pyx":116
4579  * self.A.rowptr = &rowptr[0]
4580  *
4581  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4582  * np.float64_t [:] xp,
4583  * np.float64_t [:] yp):
4584  */
4585 
4586  /* function exit code */
4587  __Pyx_RefNannyFinishContext();
4588 }
4589 
4590 /* "superluWrappers.pyx":170
4591  * cdef public int dim
4592  *
4593  * def __init__(self, dim): # <<<<<<<<<<<<<<
4594  * """
4595  * Arguments
4596  */
4597 
4598 /* Python wrapper */
4599 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4600 static char __pyx_doc_15superluWrappers_12SparseFactor___init__[] = "\n Arguments\n ---------\n dim : int\n Dimension of the sparse factor.\n ";
4601 #if CYTHON_COMPILING_IN_CPYTHON
4602 struct wrapperbase __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
4603 #endif
4604 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4605  PyObject *__pyx_v_dim = 0;
4606  int __pyx_r;
4607  __Pyx_RefNannyDeclarations
4608  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4609  {
4610  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0};
4611  PyObject* values[1] = {0};
4612  if (unlikely(__pyx_kwds)) {
4613  Py_ssize_t kw_args;
4614  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4615  switch (pos_args) {
4616  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4617  CYTHON_FALLTHROUGH;
4618  case 0: break;
4619  default: goto __pyx_L5_argtuple_error;
4620  }
4621  kw_args = PyDict_Size(__pyx_kwds);
4622  switch (pos_args) {
4623  case 0:
4624  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
4625  else goto __pyx_L5_argtuple_error;
4626  }
4627  if (unlikely(kw_args > 0)) {
4628  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 170, __pyx_L3_error)
4629  }
4630  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
4631  goto __pyx_L5_argtuple_error;
4632  } else {
4633  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4634  }
4635  __pyx_v_dim = values[0];
4636  }
4637  goto __pyx_L4_argument_unpacking_done;
4638  __pyx_L5_argtuple_error:;
4639  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 170, __pyx_L3_error)
4640  __pyx_L3_error:;
4641  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4642  __Pyx_RefNannyFinishContext();
4643  return -1;
4644  __pyx_L4_argument_unpacking_done:;
4645  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor___init__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v_dim);
4646 
4647  /* function exit code */
4648  __Pyx_RefNannyFinishContext();
4649  return __pyx_r;
4650 }
4651 
4652 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim) {
4653  int __pyx_r;
4654  __Pyx_RefNannyDeclarations
4655  PyObject *__pyx_t_1 = NULL;
4656  int __pyx_t_2;
4657  __pyx_t_5numpy_int32_t __pyx_t_3;
4658  PyObject *__pyx_t_4 = NULL;
4659  size_t __pyx_t_5;
4660  __Pyx_RefNannySetupContext("__init__", 0);
4661 
4662  /* "superluWrappers.pyx":177
4663  * Dimension of the sparse factor.
4664  * """
4665  * cStatInit(&self.stat) # <<<<<<<<<<<<<<
4666  * cset_default_options(&self.options)
4667  * self._set_mat_types()
4668  */
4669  StatInit((&__pyx_v_self->stat));
4670 
4671  /* "superluWrappers.pyx":178
4672  * """
4673  * cStatInit(&self.stat)
4674  * cset_default_options(&self.options) # <<<<<<<<<<<<<<
4675  * self._set_mat_types()
4676  * self.dim = dim
4677  */
4678  set_default_options((&__pyx_v_self->options));
4679 
4680  /* "superluWrappers.pyx":179
4681  * cStatInit(&self.stat)
4682  * cset_default_options(&self.options)
4683  * self._set_mat_types() # <<<<<<<<<<<<<<
4684  * self.dim = dim
4685  * self.A.nrow = dim ; self.A.ncol = dim
4686  */
4687  __pyx_t_1 = ((struct __pyx_vtabstruct_15superluWrappers_SparseFactor *)__pyx_v_self->__pyx_vtab)->_set_mat_types(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
4688  __Pyx_GOTREF(__pyx_t_1);
4689  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4690 
4691  /* "superluWrappers.pyx":180
4692  * cset_default_options(&self.options)
4693  * self._set_mat_types()
4694  * self.dim = dim # <<<<<<<<<<<<<<
4695  * self.A.nrow = dim ; self.A.ncol = dim
4696  * self.AC.nrow = dim ; self.AC.ncol = dim
4697  */
4698  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
4699  __pyx_v_self->dim = __pyx_t_2;
4700 
4701  /* "superluWrappers.pyx":181
4702  * self._set_mat_types()
4703  * self.dim = dim
4704  * self.A.nrow = dim ; self.A.ncol = dim # <<<<<<<<<<<<<<
4705  * self.AC.nrow = dim ; self.AC.ncol = dim
4706  * self.L.nrow = dim ; self.L.ncol = dim
4707  */
4708  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4709  __pyx_v_self->A.nrow = __pyx_t_2;
4710  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4711  __pyx_v_self->A.ncol = __pyx_t_2;
4712 
4713  /* "superluWrappers.pyx":182
4714  * self.dim = dim
4715  * self.A.nrow = dim ; self.A.ncol = dim
4716  * self.AC.nrow = dim ; self.AC.ncol = dim # <<<<<<<<<<<<<<
4717  * self.L.nrow = dim ; self.L.ncol = dim
4718  * self.U.nrow = dim ; self.U.ncol = dim
4719  */
4720  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4721  __pyx_v_self->AC.nrow = __pyx_t_2;
4722  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4723  __pyx_v_self->AC.ncol = __pyx_t_2;
4724 
4725  /* "superluWrappers.pyx":183
4726  * self.A.nrow = dim ; self.A.ncol = dim
4727  * self.AC.nrow = dim ; self.AC.ncol = dim
4728  * self.L.nrow = dim ; self.L.ncol = dim # <<<<<<<<<<<<<<
4729  * self.U.nrow = dim ; self.U.ncol = dim
4730  * self.X.nrow = dim ; self.X.ncol = 1
4731  */
4732  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4733  __pyx_v_self->L.nrow = __pyx_t_2;
4734  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4735  __pyx_v_self->L.ncol = __pyx_t_2;
4736 
4737  /* "superluWrappers.pyx":184
4738  * self.AC.nrow = dim ; self.AC.ncol = dim
4739  * self.L.nrow = dim ; self.L.ncol = dim
4740  * self.U.nrow = dim ; self.U.ncol = dim # <<<<<<<<<<<<<<
4741  * self.X.nrow = dim ; self.X.ncol = 1
4742  * self.storeX.lda = dim
4743  */
4744  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4745  __pyx_v_self->U.nrow = __pyx_t_2;
4746  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4747  __pyx_v_self->U.ncol = __pyx_t_2;
4748 
4749  /* "superluWrappers.pyx":185
4750  * self.L.nrow = dim ; self.L.ncol = dim
4751  * self.U.nrow = dim ; self.U.ncol = dim
4752  * self.X.nrow = dim ; self.X.ncol = 1 # <<<<<<<<<<<<<<
4753  * self.storeX.lda = dim
4754  * self.use_same_perm_c = 0
4755  */
4756  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4757  __pyx_v_self->X.nrow = __pyx_t_2;
4758  __pyx_v_self->X.ncol = 1;
4759 
4760  /* "superluWrappers.pyx":186
4761  * self.U.nrow = dim ; self.U.ncol = dim
4762  * self.X.nrow = dim ; self.X.ncol = 1
4763  * self.storeX.lda = dim # <<<<<<<<<<<<<<
4764  * self.use_same_perm_c = 0
4765  * self.use_same_sparsity = 0
4766  */
4767  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_v_dim); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4768  __pyx_v_self->storeX.lda = __pyx_t_3;
4769 
4770  /* "superluWrappers.pyx":187
4771  * self.X.nrow = dim ; self.X.ncol = 1
4772  * self.storeX.lda = dim
4773  * self.use_same_perm_c = 0 # <<<<<<<<<<<<<<
4774  * self.use_same_sparsity = 0
4775  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4776  */
4777  __pyx_v_self->use_same_perm_c = 0;
4778 
4779  /* "superluWrappers.pyx":188
4780  * self.storeX.lda = dim
4781  * self.use_same_perm_c = 0
4782  * self.use_same_sparsity = 0 # <<<<<<<<<<<<<<
4783  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4784  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4785  */
4786  __pyx_v_self->use_same_sparsity = 0;
4787 
4788  /* "superluWrappers.pyx":189
4789  * self.use_same_perm_c = 0
4790  * self.use_same_sparsity = 0
4791  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4792  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4793  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4794  */
4795  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
4796  __Pyx_GOTREF(__pyx_t_1);
4797  __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
4798  __Pyx_GOTREF(__pyx_t_4);
4799  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4800  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
4801  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4802  __pyx_v_self->perm_c = ((int *)malloc(__pyx_t_5));
4803 
4804  /* "superluWrappers.pyx":190
4805  * self.use_same_sparsity = 0
4806  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4807  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4808  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4809  *
4810  */
4811  __pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
4812  __Pyx_GOTREF(__pyx_t_4);
4813  __pyx_t_1 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
4814  __Pyx_GOTREF(__pyx_t_1);
4815  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4816  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L1_error)
4817  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4818  __pyx_v_self->perm_r = ((int *)malloc(__pyx_t_5));
4819 
4820  /* "superluWrappers.pyx":191
4821  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4822  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4823  * self.etree = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4824  *
4825  * cdef _set_mat_types(self):
4826  */
4827  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
4828  __Pyx_GOTREF(__pyx_t_1);
4829  __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
4830  __Pyx_GOTREF(__pyx_t_4);
4831  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4832  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
4833  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4834  __pyx_v_self->etree = ((int *)malloc(__pyx_t_5));
4835 
4836  /* "superluWrappers.pyx":170
4837  * cdef public int dim
4838  *
4839  * def __init__(self, dim): # <<<<<<<<<<<<<<
4840  * """
4841  * Arguments
4842  */
4843 
4844  /* function exit code */
4845  __pyx_r = 0;
4846  goto __pyx_L0;
4847  __pyx_L1_error:;
4848  __Pyx_XDECREF(__pyx_t_1);
4849  __Pyx_XDECREF(__pyx_t_4);
4850  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4851  __pyx_r = -1;
4852  __pyx_L0:;
4853  __Pyx_RefNannyFinishContext();
4854  return __pyx_r;
4855 }
4856 
4857 /* "superluWrappers.pyx":193
4858  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4859  *
4860  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
4861  * self.A.Stype = _SLU_NC
4862  * self.A.Dtype = _SLU_D
4863  */
4864 
4865 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
4866  PyObject *__pyx_r = NULL;
4867  __Pyx_RefNannyDeclarations
4868  __Pyx_RefNannySetupContext("_set_mat_types", 0);
4869 
4870  /* "superluWrappers.pyx":194
4871  *
4872  * cdef _set_mat_types(self):
4873  * self.A.Stype = _SLU_NC # <<<<<<<<<<<<<<
4874  * self.A.Dtype = _SLU_D
4875  * self.A.Mtype = _SLU_GE
4876  */
4877  __pyx_v_self->A.Stype = SLU_NC;
4878 
4879  /* "superluWrappers.pyx":195
4880  * cdef _set_mat_types(self):
4881  * self.A.Stype = _SLU_NC
4882  * self.A.Dtype = _SLU_D # <<<<<<<<<<<<<<
4883  * self.A.Mtype = _SLU_GE
4884  * self.A.Store = &self.storeA
4885  */
4886  __pyx_v_self->A.Dtype = SLU_D;
4887 
4888  /* "superluWrappers.pyx":196
4889  * self.A.Stype = _SLU_NC
4890  * self.A.Dtype = _SLU_D
4891  * self.A.Mtype = _SLU_GE # <<<<<<<<<<<<<<
4892  * self.A.Store = &self.storeA
4893  *
4894  */
4895  __pyx_v_self->A.Mtype = SLU_GE;
4896 
4897  /* "superluWrappers.pyx":197
4898  * self.A.Dtype = _SLU_D
4899  * self.A.Mtype = _SLU_GE
4900  * self.A.Store = &self.storeA # <<<<<<<<<<<<<<
4901  *
4902  * self.AC.Stype = _SLU_NCP
4903  */
4904  __pyx_v_self->A.Store = (&__pyx_v_self->storeA);
4905 
4906  /* "superluWrappers.pyx":199
4907  * self.A.Store = &self.storeA
4908  *
4909  * self.AC.Stype = _SLU_NCP # <<<<<<<<<<<<<<
4910  * self.AC.Dtype = _SLU_D
4911  * self.AC.Mtype = _SLU_GE
4912  */
4913  __pyx_v_self->AC.Stype = SLU_NCP;
4914 
4915  /* "superluWrappers.pyx":200
4916  *
4917  * self.AC.Stype = _SLU_NCP
4918  * self.AC.Dtype = _SLU_D # <<<<<<<<<<<<<<
4919  * self.AC.Mtype = _SLU_GE
4920  * self.AC.Store = NULL
4921  */
4922  __pyx_v_self->AC.Dtype = SLU_D;
4923 
4924  /* "superluWrappers.pyx":201
4925  * self.AC.Stype = _SLU_NCP
4926  * self.AC.Dtype = _SLU_D
4927  * self.AC.Mtype = _SLU_GE # <<<<<<<<<<<<<<
4928  * self.AC.Store = NULL
4929  *
4930  */
4931  __pyx_v_self->AC.Mtype = SLU_GE;
4932 
4933  /* "superluWrappers.pyx":202
4934  * self.AC.Dtype = _SLU_D
4935  * self.AC.Mtype = _SLU_GE
4936  * self.AC.Store = NULL # <<<<<<<<<<<<<<
4937  *
4938  * self.L.Stype = _SLU_NC
4939  */
4940  __pyx_v_self->AC.Store = NULL;
4941 
4942  /* "superluWrappers.pyx":204
4943  * self.AC.Store = NULL
4944  *
4945  * self.L.Stype = _SLU_NC # <<<<<<<<<<<<<<
4946  * self.L.Dtype = _SLU_D
4947  * self.L.Mtype = _SLU_TRLU
4948  */
4949  __pyx_v_self->L.Stype = SLU_NC;
4950 
4951  /* "superluWrappers.pyx":205
4952  *
4953  * self.L.Stype = _SLU_NC
4954  * self.L.Dtype = _SLU_D # <<<<<<<<<<<<<<
4955  * self.L.Mtype = _SLU_TRLU
4956  * self.L.Store = NULL
4957  */
4958  __pyx_v_self->L.Dtype = SLU_D;
4959 
4960  /* "superluWrappers.pyx":206
4961  * self.L.Stype = _SLU_NC
4962  * self.L.Dtype = _SLU_D
4963  * self.L.Mtype = _SLU_TRLU # <<<<<<<<<<<<<<
4964  * self.L.Store = NULL
4965  *
4966  */
4967  __pyx_v_self->L.Mtype = SLU_TRLU;
4968 
4969  /* "superluWrappers.pyx":207
4970  * self.L.Dtype = _SLU_D
4971  * self.L.Mtype = _SLU_TRLU
4972  * self.L.Store = NULL # <<<<<<<<<<<<<<
4973  *
4974  * self.U.Stype = _SLU_NC
4975  */
4976  __pyx_v_self->L.Store = NULL;
4977 
4978  /* "superluWrappers.pyx":209
4979  * self.L.Store = NULL
4980  *
4981  * self.U.Stype = _SLU_NC # <<<<<<<<<<<<<<
4982  * self.U.Dtype = _SLU_D
4983  * self.U.Mtype = _SLU_TRU
4984  */
4985  __pyx_v_self->U.Stype = SLU_NC;
4986 
4987  /* "superluWrappers.pyx":210
4988  *
4989  * self.U.Stype = _SLU_NC
4990  * self.U.Dtype = _SLU_D # <<<<<<<<<<<<<<
4991  * self.U.Mtype = _SLU_TRU
4992  * self.U.Store = NULL
4993  */
4994  __pyx_v_self->U.Dtype = SLU_D;
4995 
4996  /* "superluWrappers.pyx":211
4997  * self.U.Stype = _SLU_NC
4998  * self.U.Dtype = _SLU_D
4999  * self.U.Mtype = _SLU_TRU # <<<<<<<<<<<<<<
5000  * self.U.Store = NULL
5001  *
5002  */
5003  __pyx_v_self->U.Mtype = SLU_TRU;
5004 
5005  /* "superluWrappers.pyx":212
5006  * self.U.Dtype = _SLU_D
5007  * self.U.Mtype = _SLU_TRU
5008  * self.U.Store = NULL # <<<<<<<<<<<<<<
5009  *
5010  * self.X.Stype = _SLU_DN
5011  */
5012  __pyx_v_self->U.Store = NULL;
5013 
5014  /* "superluWrappers.pyx":214
5015  * self.U.Store = NULL
5016  *
5017  * self.X.Stype = _SLU_DN # <<<<<<<<<<<<<<
5018  * self.X.Dtype = _SLU_D
5019  * self.X.Mtype = _SLU_GE
5020  */
5021  __pyx_v_self->X.Stype = SLU_DN;
5022 
5023  /* "superluWrappers.pyx":215
5024  *
5025  * self.X.Stype = _SLU_DN
5026  * self.X.Dtype = _SLU_D # <<<<<<<<<<<<<<
5027  * self.X.Mtype = _SLU_GE
5028  * self.X.Store = &self.storeX
5029  */
5030  __pyx_v_self->X.Dtype = SLU_D;
5031 
5032  /* "superluWrappers.pyx":216
5033  * self.X.Stype = _SLU_DN
5034  * self.X.Dtype = _SLU_D
5035  * self.X.Mtype = _SLU_GE # <<<<<<<<<<<<<<
5036  * self.X.Store = &self.storeX
5037  *
5038  */
5039  __pyx_v_self->X.Mtype = SLU_GE;
5040 
5041  /* "superluWrappers.pyx":217
5042  * self.X.Dtype = _SLU_D
5043  * self.X.Mtype = _SLU_GE
5044  * self.X.Store = &self.storeX # <<<<<<<<<<<<<<
5045  *
5046  * def sparseFactorPrepare(sparse_matrix,
5047  */
5048  __pyx_v_self->X.Store = (&__pyx_v_self->storeX);
5049 
5050  /* "superluWrappers.pyx":193
5051  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
5052  *
5053  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
5054  * self.A.Stype = _SLU_NC
5055  * self.A.Dtype = _SLU_D
5056  */
5057 
5058  /* function exit code */
5059  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5060  __Pyx_XGIVEREF(__pyx_r);
5061  __Pyx_RefNannyFinishContext();
5062  return __pyx_r;
5063 }
5064 
5065 /* "superluWrappers.pyx":168
5066  * cdef unsigned int use_same_sparsity
5067  *
5068  * cdef public int dim # <<<<<<<<<<<<<<
5069  *
5070  * def __init__(self, dim):
5071  */
5072 
5073 /* Python wrapper */
5074 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/
5075 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self) {
5076  PyObject *__pyx_r = 0;
5077  __Pyx_RefNannyDeclarations
5078  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5079  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5080 
5081  /* function exit code */
5082  __Pyx_RefNannyFinishContext();
5083  return __pyx_r;
5084 }
5085 
5086 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5087  PyObject *__pyx_r = NULL;
5088  __Pyx_RefNannyDeclarations
5089  PyObject *__pyx_t_1 = NULL;
5090  __Pyx_RefNannySetupContext("__get__", 0);
5091  __Pyx_XDECREF(__pyx_r);
5092  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
5093  __Pyx_GOTREF(__pyx_t_1);
5094  __pyx_r = __pyx_t_1;
5095  __pyx_t_1 = 0;
5096  goto __pyx_L0;
5097 
5098  /* function exit code */
5099  __pyx_L1_error:;
5100  __Pyx_XDECREF(__pyx_t_1);
5101  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5102  __pyx_r = NULL;
5103  __pyx_L0:;
5104  __Pyx_XGIVEREF(__pyx_r);
5105  __Pyx_RefNannyFinishContext();
5106  return __pyx_r;
5107 }
5108 
5109 /* Python wrapper */
5110 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
5111 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5112  int __pyx_r;
5113  __Pyx_RefNannyDeclarations
5114  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5115  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5116 
5117  /* function exit code */
5118  __Pyx_RefNannyFinishContext();
5119  return __pyx_r;
5120 }
5121 
5122 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value) {
5123  int __pyx_r;
5124  __Pyx_RefNannyDeclarations
5125  int __pyx_t_1;
5126  __Pyx_RefNannySetupContext("__set__", 0);
5127  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
5128  __pyx_v_self->dim = __pyx_t_1;
5129 
5130  /* function exit code */
5131  __pyx_r = 0;
5132  goto __pyx_L0;
5133  __pyx_L1_error:;
5134  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5135  __pyx_r = -1;
5136  __pyx_L0:;
5137  __Pyx_RefNannyFinishContext();
5138  return __pyx_r;
5139 }
5140 
5141 /* "(tree fragment)":1
5142  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5143  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5144  * def __setstate_cython__(self, __pyx_state):
5145  */
5146 
5147 /* Python wrapper */
5148 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5149 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5150  PyObject *__pyx_r = 0;
5151  __Pyx_RefNannyDeclarations
5152  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5153  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5154 
5155  /* function exit code */
5156  __Pyx_RefNannyFinishContext();
5157  return __pyx_r;
5158 }
5159 
5160 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5161  PyObject *__pyx_r = NULL;
5162  __Pyx_RefNannyDeclarations
5163  PyObject *__pyx_t_1 = NULL;
5164  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5165 
5166  /* "(tree fragment)":2
5167  * def __reduce_cython__(self):
5168  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5169  * def __setstate_cython__(self, __pyx_state):
5170  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5171  */
5172  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5173  __Pyx_GOTREF(__pyx_t_1);
5174  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5175  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5176  __PYX_ERR(1, 2, __pyx_L1_error)
5177 
5178  /* "(tree fragment)":1
5179  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5180  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5181  * def __setstate_cython__(self, __pyx_state):
5182  */
5183 
5184  /* function exit code */
5185  __pyx_L1_error:;
5186  __Pyx_XDECREF(__pyx_t_1);
5187  __Pyx_AddTraceback("superluWrappers.SparseFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5188  __pyx_r = NULL;
5189  __Pyx_XGIVEREF(__pyx_r);
5190  __Pyx_RefNannyFinishContext();
5191  return __pyx_r;
5192 }
5193 
5194 /* "(tree fragment)":3
5195  * def __reduce_cython__(self):
5196  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5197  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5198  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5199  */
5200 
5201 /* Python wrapper */
5202 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5203 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5204  PyObject *__pyx_r = 0;
5205  __Pyx_RefNannyDeclarations
5206  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5207  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5208 
5209  /* function exit code */
5210  __Pyx_RefNannyFinishContext();
5211  return __pyx_r;
5212 }
5213 
5214 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5215  PyObject *__pyx_r = NULL;
5216  __Pyx_RefNannyDeclarations
5217  PyObject *__pyx_t_1 = NULL;
5218  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5219 
5220  /* "(tree fragment)":4
5221  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5222  * def __setstate_cython__(self, __pyx_state):
5223  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5224  */
5225  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5226  __Pyx_GOTREF(__pyx_t_1);
5227  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5228  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5229  __PYX_ERR(1, 4, __pyx_L1_error)
5230 
5231  /* "(tree fragment)":3
5232  * def __reduce_cython__(self):
5233  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5234  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5235  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5236  */
5237 
5238  /* function exit code */
5239  __pyx_L1_error:;
5240  __Pyx_XDECREF(__pyx_t_1);
5241  __Pyx_AddTraceback("superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5242  __pyx_r = NULL;
5243  __Pyx_XGIVEREF(__pyx_r);
5244  __Pyx_RefNannyFinishContext();
5245  return __pyx_r;
5246 }
5247 
5248 /* "superluWrappers.pyx":219
5249  * self.X.Store = &self.storeX
5250  *
5251  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5252  * sparseFactor):
5253  * """ Python wrapper for superlu Sparse Factor Prepare function.
5254  */
5255 
5256 /* Python wrapper */
5257 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5258 static char __pyx_doc_15superluWrappers_sparseFactorPrepare[] = " Python wrapper for superlu Sparse Factor Prepare function.\n\n Arguments\n ---------\n sparse_matrix : superluWrappers.SparseMatrix\n sparseFactor: superluWrappers.SparseFactor\n\n ";
5259 static PyMethodDef __pyx_mdef_15superluWrappers_1sparseFactorPrepare = {"sparseFactorPrepare", (PyCFunction)__pyx_pw_15superluWrappers_1sparseFactorPrepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_sparseFactorPrepare};
5260 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5261  PyObject *__pyx_v_sparse_matrix = 0;
5262  PyObject *__pyx_v_sparseFactor = 0;
5263  PyObject *__pyx_r = 0;
5264  __Pyx_RefNannyDeclarations
5265  __Pyx_RefNannySetupContext("sparseFactorPrepare (wrapper)", 0);
5266  {
5267  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparse_matrix,&__pyx_n_s_sparseFactor,0};
5268  PyObject* values[2] = {0,0};
5269  if (unlikely(__pyx_kwds)) {
5270  Py_ssize_t kw_args;
5271  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5272  switch (pos_args) {
5273  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5274  CYTHON_FALLTHROUGH;
5275  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5276  CYTHON_FALLTHROUGH;
5277  case 0: break;
5278  default: goto __pyx_L5_argtuple_error;
5279  }
5280  kw_args = PyDict_Size(__pyx_kwds);
5281  switch (pos_args) {
5282  case 0:
5283  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparse_matrix)) != 0)) kw_args--;
5284  else goto __pyx_L5_argtuple_error;
5285  CYTHON_FALLTHROUGH;
5286  case 1:
5287  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5288  else {
5289  __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, 1); __PYX_ERR(0, 219, __pyx_L3_error)
5290  }
5291  }
5292  if (unlikely(kw_args > 0)) {
5293  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparseFactorPrepare") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
5294  }
5295  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5296  goto __pyx_L5_argtuple_error;
5297  } else {
5298  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5299  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5300  }
5301  __pyx_v_sparse_matrix = values[0];
5302  __pyx_v_sparseFactor = values[1];
5303  }
5304  goto __pyx_L4_argument_unpacking_done;
5305  __pyx_L5_argtuple_error:;
5306  __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
5307  __pyx_L3_error:;
5308  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5309  __Pyx_RefNannyFinishContext();
5310  return NULL;
5311  __pyx_L4_argument_unpacking_done:;
5312  __pyx_r = __pyx_pf_15superluWrappers_sparseFactorPrepare(__pyx_self, __pyx_v_sparse_matrix, __pyx_v_sparseFactor);
5313 
5314  /* function exit code */
5315  __Pyx_RefNannyFinishContext();
5316  return __pyx_r;
5317 }
5318 
5319 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor) {
5320  PyObject *__pyx_r = NULL;
5321  __Pyx_RefNannyDeclarations
5322  PyObject *__pyx_t_1 = NULL;
5323  __Pyx_RefNannySetupContext("sparseFactorPrepare", 0);
5324 
5325  /* "superluWrappers.pyx":229
5326  *
5327  * """
5328  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5329  * sparseFactor)
5330  *
5331  */
5332  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sparse_matrix, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5333  __Pyx_GOTREF(__pyx_t_1);
5334  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5335 
5336  /* "superluWrappers.pyx":230
5337  * """
5338  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix,
5339  * sparseFactor) # <<<<<<<<<<<<<<
5340  *
5341  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm,
5342  */
5343  if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 230, __pyx_L1_error)
5344 
5345  /* "superluWrappers.pyx":229
5346  *
5347  * """
5348  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5349  * sparseFactor)
5350  *
5351  */
5352  __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor));
5353  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5354 
5355  /* "superluWrappers.pyx":219
5356  * self.X.Store = &self.storeX
5357  *
5358  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5359  * sparseFactor):
5360  * """ Python wrapper for superlu Sparse Factor Prepare function.
5361  */
5362 
5363  /* function exit code */
5364  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5365  goto __pyx_L0;
5366  __pyx_L1_error:;
5367  __Pyx_XDECREF(__pyx_t_1);
5368  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5369  __pyx_r = NULL;
5370  __pyx_L0:;
5371  __Pyx_XGIVEREF(__pyx_r);
5372  __Pyx_RefNannyFinishContext();
5373  return __pyx_r;
5374 }
5375 
5376 /* "superluWrappers.pyx":232
5377  * sparseFactor)
5378  *
5379  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5380  * SparseFactor sparseFactor):
5381  *
5382  */
5383 
5384 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor) {
5385  int __pyx_v_permc_spec;
5386  int __pyx_v_n;
5387  int __pyx_v_relax;
5388  int __pyx_v_panel_size;
5389  int __pyx_v_lwork;
5390  int __pyx_v_info;
5391  void *__pyx_v_work;
5392  PyObject *__pyx_v_i = NULL;
5393  __Pyx_RefNannyDeclarations
5394  __pyx_t_5numpy_int32_t __pyx_t_1;
5395  int __pyx_t_2;
5396  int __pyx_t_3;
5397  PyObject *__pyx_t_4 = NULL;
5398  PyObject *__pyx_t_5 = NULL;
5399  Py_ssize_t __pyx_t_6;
5400  PyObject *(*__pyx_t_7)(PyObject *);
5401  Py_ssize_t __pyx_t_8;
5402  Py_ssize_t __pyx_t_9;
5403  __Pyx_RefNannySetupContext("superluWrappersSparseFactorPrepare", 0);
5404 
5405  /* "superluWrappers.pyx":235
5406  * SparseFactor sparseFactor):
5407  *
5408  * cdef int permc_spec = 3 # <<<<<<<<<<<<<<
5409  * cdef int n
5410  * cdef int relax=1
5411  */
5412  __pyx_v_permc_spec = 3;
5413 
5414  /* "superluWrappers.pyx":237
5415  * cdef int permc_spec = 3
5416  * cdef int n
5417  * cdef int relax=1 # <<<<<<<<<<<<<<
5418  * cdef int panel_size = 10
5419  * cdef int lwork = 0
5420  */
5421  __pyx_v_relax = 1;
5422 
5423  /* "superluWrappers.pyx":238
5424  * cdef int n
5425  * cdef int relax=1
5426  * cdef int panel_size = 10 # <<<<<<<<<<<<<<
5427  * cdef int lwork = 0
5428  * cdef int info = 0
5429  */
5430  __pyx_v_panel_size = 10;
5431 
5432  /* "superluWrappers.pyx":239
5433  * cdef int relax=1
5434  * cdef int panel_size = 10
5435  * cdef int lwork = 0 # <<<<<<<<<<<<<<
5436  * cdef int info = 0
5437  * cdef void *work = NULL
5438  */
5439  __pyx_v_lwork = 0;
5440 
5441  /* "superluWrappers.pyx":240
5442  * cdef int panel_size = 10
5443  * cdef int lwork = 0
5444  * cdef int info = 0 # <<<<<<<<<<<<<<
5445  * cdef void *work = NULL
5446  *
5447  */
5448  __pyx_v_info = 0;
5449 
5450  /* "superluWrappers.pyx":241
5451  * cdef int lwork = 0
5452  * cdef int info = 0
5453  * cdef void *work = NULL # <<<<<<<<<<<<<<
5454  *
5455  * sparseFactor.storeA.nnz = sm.A.nnz
5456  */
5457  __pyx_v_work = NULL;
5458 
5459  /* "superluWrappers.pyx":243
5460  * cdef void *work = NULL
5461  *
5462  * sparseFactor.storeA.nnz = sm.A.nnz # <<<<<<<<<<<<<<
5463  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5464  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5465  */
5466  __pyx_t_1 = __pyx_v_sm->A.nnz;
5467  __pyx_v_sparseFactor->storeA.nnz = __pyx_t_1;
5468 
5469  /* "superluWrappers.pyx":244
5470  *
5471  * sparseFactor.storeA.nnz = sm.A.nnz
5472  * sparseFactor.storeA.nzval = &sm.A.nzval[0] # <<<<<<<<<<<<<<
5473  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5474  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5475  */
5476  __pyx_v_sparseFactor->storeA.nzval = (&(__pyx_v_sm->A.nzval[0]));
5477 
5478  /* "superluWrappers.pyx":245
5479  * sparseFactor.storeA.nnz = sm.A.nnz
5480  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5481  * sparseFactor.storeA.colptr = &sm.A.rowptr[0] # <<<<<<<<<<<<<<
5482  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5483  *
5484  */
5485  __pyx_v_sparseFactor->storeA.colptr = (&(__pyx_v_sm->A.rowptr[0]));
5486 
5487  /* "superluWrappers.pyx":246
5488  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5489  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5490  * sparseFactor.storeA.rowind = &sm.A.colind[0] # <<<<<<<<<<<<<<
5491  *
5492  * if sparseFactor.use_same_perm_c == 0:
5493  */
5494  __pyx_v_sparseFactor->storeA.rowind = (&(__pyx_v_sm->A.colind[0]));
5495 
5496  /* "superluWrappers.pyx":248
5497  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5498  *
5499  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5500  * cget_perm_c(permc_spec,
5501  * &sparseFactor.A,
5502  */
5503  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_perm_c == 0) != 0);
5504  if (__pyx_t_2) {
5505 
5506  /* "superluWrappers.pyx":249
5507  *
5508  * if sparseFactor.use_same_perm_c == 0:
5509  * cget_perm_c(permc_spec, # <<<<<<<<<<<<<<
5510  * &sparseFactor.A,
5511  * sparseFactor.perm_c)
5512  */
5513  get_perm_c(__pyx_v_permc_spec, (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c);
5514 
5515  /* "superluWrappers.pyx":252
5516  * &sparseFactor.A,
5517  * sparseFactor.perm_c)
5518  * sparseFactor.use_same_perm_c = 1 # <<<<<<<<<<<<<<
5519  *
5520  * if sparseFactor.use_same_sparsity == 0:
5521  */
5522  __pyx_v_sparseFactor->use_same_perm_c = 1;
5523 
5524  /* "superluWrappers.pyx":248
5525  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5526  *
5527  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5528  * cget_perm_c(permc_spec,
5529  * &sparseFactor.A,
5530  */
5531  }
5532 
5533  /* "superluWrappers.pyx":254
5534  * sparseFactor.use_same_perm_c = 1
5535  *
5536  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5537  * if sparseFactor.AC.Store != NULL:
5538  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5539  */
5540  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_sparsity == 0) != 0);
5541  if (__pyx_t_2) {
5542 
5543  /* "superluWrappers.pyx":255
5544  *
5545  * if sparseFactor.use_same_sparsity == 0:
5546  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5547  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5548  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5549  */
5550  __pyx_t_2 = ((__pyx_v_sparseFactor->AC.Store != NULL) != 0);
5551  if (__pyx_t_2) {
5552 
5553  /* "superluWrappers.pyx":256
5554  * if sparseFactor.use_same_sparsity == 0:
5555  * if sparseFactor.AC.Store != NULL:
5556  * cDestroy_CompCol_Permuted(&sparseFactor.AC) # <<<<<<<<<<<<<<
5557  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5558  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5559  */
5560  Destroy_CompCol_Permuted((&__pyx_v_sparseFactor->AC));
5561 
5562  /* "superluWrappers.pyx":257
5563  * if sparseFactor.AC.Store != NULL:
5564  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5565  * cDestroy_SuperNode_Matrix(&sparseFactor.L) # <<<<<<<<<<<<<<
5566  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5567  * csp_preorder(&sparseFactor.options,
5568  */
5569  Destroy_SuperNode_Matrix((&__pyx_v_sparseFactor->L));
5570 
5571  /* "superluWrappers.pyx":258
5572  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5573  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5574  * cDestroy_CompCol_Matrix(&sparseFactor.U) # <<<<<<<<<<<<<<
5575  * csp_preorder(&sparseFactor.options,
5576  * &sparseFactor.A,
5577  */
5578  Destroy_CompCol_Matrix((&__pyx_v_sparseFactor->U));
5579 
5580  /* "superluWrappers.pyx":255
5581  *
5582  * if sparseFactor.use_same_sparsity == 0:
5583  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5584  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5585  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5586  */
5587  }
5588 
5589  /* "superluWrappers.pyx":259
5590  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5591  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5592  * csp_preorder(&sparseFactor.options, # <<<<<<<<<<<<<<
5593  * &sparseFactor.A,
5594  * sparseFactor.perm_c,
5595  */
5596  sp_preorder((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->etree, (&__pyx_v_sparseFactor->AC));
5597 
5598  /* "superluWrappers.pyx":264
5599  * sparseFactor.etree,
5600  * &sparseFactor.AC)
5601  * sparseFactor.use_same_sparsity = 1 # <<<<<<<<<<<<<<
5602  * else:
5603  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5604  */
5605  __pyx_v_sparseFactor->use_same_sparsity = 1;
5606 
5607  /* "superluWrappers.pyx":254
5608  * sparseFactor.use_same_perm_c = 1
5609  *
5610  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5611  * if sparseFactor.AC.Store != NULL:
5612  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5613  */
5614  goto __pyx_L4;
5615  }
5616 
5617  /* "superluWrappers.pyx":266
5618  * sparseFactor.use_same_sparsity = 1
5619  * else:
5620  * sparseFactor.options.Fact = _SamePattern_SameRowPerm # <<<<<<<<<<<<<<
5621  * n = sparseFactor.A.ncol
5622  * for i in range(n):
5623  */
5624  /*else*/ {
5625  __pyx_v_sparseFactor->options.Fact = SamePattern_SameRowPerm;
5626 
5627  /* "superluWrappers.pyx":267
5628  * else:
5629  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5630  * n = sparseFactor.A.ncol # <<<<<<<<<<<<<<
5631  * for i in range(n):
5632  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5633  */
5634  __pyx_t_3 = __pyx_v_sparseFactor->A.ncol;
5635  __pyx_v_n = __pyx_t_3;
5636 
5637  /* "superluWrappers.pyx":268
5638  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5639  * n = sparseFactor.A.ncol
5640  * for i in range(n): # <<<<<<<<<<<<<<
5641  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5642  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5643  */
5644  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5645  __Pyx_GOTREF(__pyx_t_4);
5646  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5647  __Pyx_GOTREF(__pyx_t_5);
5648  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5649  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
5650  __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
5651  __pyx_t_7 = NULL;
5652  } else {
5653  __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5654  __Pyx_GOTREF(__pyx_t_4);
5655  __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
5656  }
5657  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5658  for (;;) {
5659  if (likely(!__pyx_t_7)) {
5660  if (likely(PyList_CheckExact(__pyx_t_4))) {
5661  if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
5662  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5663  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5664  #else
5665  __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5666  __Pyx_GOTREF(__pyx_t_5);
5667  #endif
5668  } else {
5669  if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
5670  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5671  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5672  #else
5673  __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5674  __Pyx_GOTREF(__pyx_t_5);
5675  #endif
5676  }
5677  } else {
5678  __pyx_t_5 = __pyx_t_7(__pyx_t_4);
5679  if (unlikely(!__pyx_t_5)) {
5680  PyObject* exc_type = PyErr_Occurred();
5681  if (exc_type) {
5682  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5683  else __PYX_ERR(0, 268, __pyx_L1_error)
5684  }
5685  break;
5686  }
5687  __Pyx_GOTREF(__pyx_t_5);
5688  }
5689  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
5690  __pyx_t_5 = 0;
5691 
5692  /* "superluWrappers.pyx":269
5693  * n = sparseFactor.A.ncol
5694  * for i in range(n):
5695  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i] # <<<<<<<<<<<<<<
5696  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5697  * cdgstrf(&sparseFactor.options,
5698  */
5699  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5700  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5701  (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colbeg[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5702 
5703  /* "superluWrappers.pyx":270
5704  * for i in range(n):
5705  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5706  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1] # <<<<<<<<<<<<<<
5707  * cdgstrf(&sparseFactor.options,
5708  * &sparseFactor.AC,
5709  */
5710  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error)
5711  __Pyx_GOTREF(__pyx_t_5);
5712  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5713  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5714  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5715  (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colend[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5716 
5717  /* "superluWrappers.pyx":268
5718  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5719  * n = sparseFactor.A.ncol
5720  * for i in range(n): # <<<<<<<<<<<<<<
5721  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5722  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5723  */
5724  }
5725  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5726  }
5727  __pyx_L4:;
5728 
5729  /* "superluWrappers.pyx":271
5730  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5731  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5732  * cdgstrf(&sparseFactor.options, # <<<<<<<<<<<<<<
5733  * &sparseFactor.AC,
5734  * relax,
5735  */
5736  dgstrf((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->AC), __pyx_v_relax, __pyx_v_panel_size, __pyx_v_sparseFactor->etree, __pyx_v_work, __pyx_v_lwork, __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), (&__pyx_v_sparseFactor->Glu), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
5737 
5738  /* "superluWrappers.pyx":232
5739  * sparseFactor)
5740  *
5741  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5742  * SparseFactor sparseFactor):
5743  *
5744  */
5745 
5746  /* function exit code */
5747  goto __pyx_L0;
5748  __pyx_L1_error:;
5749  __Pyx_XDECREF(__pyx_t_4);
5750  __Pyx_XDECREF(__pyx_t_5);
5751  __Pyx_WriteUnraisable("superluWrappers.superluWrappersSparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5752  __pyx_L0:;
5753  __Pyx_XDECREF(__pyx_v_i);
5754  __Pyx_RefNannyFinishContext();
5755 }
5756 
5757 /* "superluWrappers.pyx":286
5758  * &info)
5759  *
5760  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5761  * x):
5762  * """ Sparse factor solve wrappers
5763  */
5764 
5765 /* Python wrapper */
5766 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5767 static char __pyx_doc_15superluWrappers_2sparseFactorSolve[] = " Sparse factor solve wrappers\n\n Arguments\n ---------\n sparseFactor : superluWrappers.SparseFactor\n x (input / output) : np.array\n x serves as the right hand side and then becomes the solution\n ";
5768 static PyMethodDef __pyx_mdef_15superluWrappers_3sparseFactorSolve = {"sparseFactorSolve", (PyCFunction)__pyx_pw_15superluWrappers_3sparseFactorSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_2sparseFactorSolve};
5769 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5770  PyObject *__pyx_v_sparseFactor = 0;
5771  PyObject *__pyx_v_x = 0;
5772  PyObject *__pyx_r = 0;
5773  __Pyx_RefNannyDeclarations
5774  __Pyx_RefNannySetupContext("sparseFactorSolve (wrapper)", 0);
5775  {
5776  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparseFactor,&__pyx_n_s_x,0};
5777  PyObject* values[2] = {0,0};
5778  if (unlikely(__pyx_kwds)) {
5779  Py_ssize_t kw_args;
5780  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5781  switch (pos_args) {
5782  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5783  CYTHON_FALLTHROUGH;
5784  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5785  CYTHON_FALLTHROUGH;
5786  case 0: break;
5787  default: goto __pyx_L5_argtuple_error;
5788  }
5789  kw_args = PyDict_Size(__pyx_kwds);
5790  switch (pos_args) {
5791  case 0:
5792  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5793  else goto __pyx_L5_argtuple_error;
5794  CYTHON_FALLTHROUGH;
5795  case 1:
5796  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5797  else {
5798  __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, 1); __PYX_ERR(0, 286, __pyx_L3_error)
5799  }
5800  }
5801  if (unlikely(kw_args > 0)) {
5802  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparseFactorSolve") < 0)) __PYX_ERR(0, 286, __pyx_L3_error)
5803  }
5804  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5805  goto __pyx_L5_argtuple_error;
5806  } else {
5807  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5808  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5809  }
5810  __pyx_v_sparseFactor = values[0];
5811  __pyx_v_x = values[1];
5812  }
5813  goto __pyx_L4_argument_unpacking_done;
5814  __pyx_L5_argtuple_error:;
5815  __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 286, __pyx_L3_error)
5816  __pyx_L3_error:;
5817  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5818  __Pyx_RefNannyFinishContext();
5819  return NULL;
5820  __pyx_L4_argument_unpacking_done:;
5821  __pyx_r = __pyx_pf_15superluWrappers_2sparseFactorSolve(__pyx_self, __pyx_v_sparseFactor, __pyx_v_x);
5822 
5823  /* function exit code */
5824  __Pyx_RefNannyFinishContext();
5825  return __pyx_r;
5826 }
5827 
5828 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x) {
5829  PyObject *__pyx_r = NULL;
5830  __Pyx_RefNannyDeclarations
5831  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
5832  __Pyx_RefNannySetupContext("sparseFactorSolve", 0);
5833 
5834  /* "superluWrappers.pyx":296
5835  * x serves as the right hand side and then becomes the solution
5836  * """
5837  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5838  * x)
5839  *
5840  */
5841  if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 296, __pyx_L1_error)
5842 
5843  /* "superluWrappers.pyx":297
5844  * """
5845  * superluWrappersSparseFactorSolve(sparseFactor,
5846  * x) # <<<<<<<<<<<<<<
5847  *
5848  *
5849  */
5850  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
5851 
5852  /* "superluWrappers.pyx":296
5853  * x serves as the right hand side and then becomes the solution
5854  * """
5855  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5856  * x)
5857  *
5858  */
5859  __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor), __pyx_t_1);
5860  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5861  __pyx_t_1.memview = NULL;
5862  __pyx_t_1.data = NULL;
5863 
5864  /* "superluWrappers.pyx":286
5865  * &info)
5866  *
5867  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5868  * x):
5869  * """ Sparse factor solve wrappers
5870  */
5871 
5872  /* function exit code */
5873  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5874  goto __pyx_L0;
5875  __pyx_L1_error:;
5876  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5877  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5878  __pyx_r = NULL;
5879  __pyx_L0:;
5880  __Pyx_XGIVEREF(__pyx_r);
5881  __Pyx_RefNannyFinishContext();
5882  return __pyx_r;
5883 }
5884 
5885 /* "superluWrappers.pyx":300
5886  *
5887  *
5888  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
5889  * np.float64_t [:] x):
5890  * cdef _trans_t trans = _TRANS
5891  */
5892 
5893 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor, __Pyx_memviewslice __pyx_v_x) {
5894  trans_t __pyx_v_trans;
5895  int __pyx_v_info;
5896  __Pyx_RefNannyDeclarations
5897  Py_ssize_t __pyx_t_1;
5898  __Pyx_RefNannySetupContext("superluWrappersSparseFactorSolve", 0);
5899 
5900  /* "superluWrappers.pyx":302
5901  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor,
5902  * np.float64_t [:] x):
5903  * cdef _trans_t trans = _TRANS # <<<<<<<<<<<<<<
5904  * cdef int info = 0
5905  *
5906  */
5907  __pyx_v_trans = TRANS;
5908 
5909  /* "superluWrappers.pyx":303
5910  * np.float64_t [:] x):
5911  * cdef _trans_t trans = _TRANS
5912  * cdef int info = 0 # <<<<<<<<<<<<<<
5913  *
5914  * sparseFactor.storeX.nzval = &x[0]
5915  */
5916  __pyx_v_info = 0;
5917 
5918  /* "superluWrappers.pyx":305
5919  * cdef int info = 0
5920  *
5921  * sparseFactor.storeX.nzval = &x[0] # <<<<<<<<<<<<<<
5922  *
5923  * cdgstrs(trans,
5924  */
5925  __pyx_t_1 = 0;
5926  __pyx_v_sparseFactor->storeX.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) ))));
5927 
5928  /* "superluWrappers.pyx":307
5929  * sparseFactor.storeX.nzval = &x[0]
5930  *
5931  * cdgstrs(trans, # <<<<<<<<<<<<<<
5932  * &sparseFactor.L,
5933  * &sparseFactor.U,
5934  */
5935  dgstrs(__pyx_v_trans, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->X), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
5936 
5937  /* "superluWrappers.pyx":300
5938  *
5939  *
5940  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
5941  * np.float64_t [:] x):
5942  * cdef _trans_t trans = _TRANS
5943  */
5944 
5945  /* function exit code */
5946  __Pyx_RefNannyFinishContext();
5947 }
5948 
5949 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
5950  * # experimental exception made for __getbuffer__ and __releasebuffer__
5951  * # -- the details of this may change.
5952  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
5953  * # This implementation of getbuffer is geared towards Cython
5954  * # requirements, and does not yet fulfill the PEP.
5955  */
5956 
5957 /* Python wrapper */
5958 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5959 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5960  int __pyx_r;
5961  __Pyx_RefNannyDeclarations
5962  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5963  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5964 
5965  /* function exit code */
5966  __Pyx_RefNannyFinishContext();
5967  return __pyx_r;
5968 }
5969 
5970 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5971  int __pyx_v_i;
5972  int __pyx_v_ndim;
5973  int __pyx_v_endian_detector;
5974  int __pyx_v_little_endian;
5975  int __pyx_v_t;
5976  char *__pyx_v_f;
5977  PyArray_Descr *__pyx_v_descr = 0;
5978  int __pyx_v_offset;
5979  int __pyx_r;
5980  __Pyx_RefNannyDeclarations
5981  int __pyx_t_1;
5982  int __pyx_t_2;
5983  PyObject *__pyx_t_3 = NULL;
5984  int __pyx_t_4;
5985  int __pyx_t_5;
5986  int __pyx_t_6;
5987  PyObject *__pyx_t_7 = NULL;
5988  char *__pyx_t_8;
5989  if (__pyx_v_info == NULL) {
5990  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5991  return -1;
5992  }
5993  __Pyx_RefNannySetupContext("__getbuffer__", 0);
5994  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5995  __Pyx_GIVEREF(__pyx_v_info->obj);
5996 
5997  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
5998  *
5999  * cdef int i, ndim
6000  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6001  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6002  *
6003  */
6004  __pyx_v_endian_detector = 1;
6005 
6006  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
6007  * cdef int i, ndim
6008  * cdef int endian_detector = 1
6009  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6010  *
6011  * ndim = PyArray_NDIM(self)
6012  */
6013  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6014 
6015  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225
6016  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6017  *
6018  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
6019  *
6020  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6021  */
6022  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6023 
6024  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
6025  * ndim = PyArray_NDIM(self)
6026  *
6027  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6028  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6029  * raise ValueError(u"ndarray is not C contiguous")
6030  */
6031  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6032  if (__pyx_t_2) {
6033  } else {
6034  __pyx_t_1 = __pyx_t_2;
6035  goto __pyx_L4_bool_binop_done;
6036  }
6037 
6038  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
6039  *
6040  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6041  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
6042  * raise ValueError(u"ndarray is not C contiguous")
6043  *
6044  */
6045  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
6046  __pyx_t_1 = __pyx_t_2;
6047  __pyx_L4_bool_binop_done:;
6048 
6049  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
6050  * ndim = PyArray_NDIM(self)
6051  *
6052  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6053  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6054  * raise ValueError(u"ndarray is not C contiguous")
6055  */
6056  if (unlikely(__pyx_t_1)) {
6057 
6058  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
6059  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6060  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6061  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6062  *
6063  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6064  */
6065  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error)
6066  __Pyx_GOTREF(__pyx_t_3);
6067  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6068  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6069  __PYX_ERR(2, 229, __pyx_L1_error)
6070 
6071  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
6072  * ndim = PyArray_NDIM(self)
6073  *
6074  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6075  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6076  * raise ValueError(u"ndarray is not C contiguous")
6077  */
6078  }
6079 
6080  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
6081  * raise ValueError(u"ndarray is not C contiguous")
6082  *
6083  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6084  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6085  * raise ValueError(u"ndarray is not Fortran contiguous")
6086  */
6087  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
6088  if (__pyx_t_2) {
6089  } else {
6090  __pyx_t_1 = __pyx_t_2;
6091  goto __pyx_L7_bool_binop_done;
6092  }
6093 
6094  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
6095  *
6096  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6097  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
6098  * raise ValueError(u"ndarray is not Fortran contiguous")
6099  *
6100  */
6101  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
6102  __pyx_t_1 = __pyx_t_2;
6103  __pyx_L7_bool_binop_done:;
6104 
6105  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
6106  * raise ValueError(u"ndarray is not C contiguous")
6107  *
6108  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6109  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6110  * raise ValueError(u"ndarray is not Fortran contiguous")
6111  */
6112  if (unlikely(__pyx_t_1)) {
6113 
6114  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
6115  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6116  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6117  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
6118  *
6119  * info.buf = PyArray_DATA(self)
6120  */
6121  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 233, __pyx_L1_error)
6122  __Pyx_GOTREF(__pyx_t_3);
6123  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6124  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6125  __PYX_ERR(2, 233, __pyx_L1_error)
6126 
6127  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
6128  * raise ValueError(u"ndarray is not C contiguous")
6129  *
6130  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6131  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6132  * raise ValueError(u"ndarray is not Fortran contiguous")
6133  */
6134  }
6135 
6136  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
6137  * raise ValueError(u"ndarray is not Fortran contiguous")
6138  *
6139  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
6140  * info.ndim = ndim
6141  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6142  */
6143  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
6144 
6145  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
6146  *
6147  * info.buf = PyArray_DATA(self)
6148  * info.ndim = ndim # <<<<<<<<<<<<<<
6149  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6150  * # Allocate new buffer for strides and shape info.
6151  */
6152  __pyx_v_info->ndim = __pyx_v_ndim;
6153 
6154  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
6155  * info.buf = PyArray_DATA(self)
6156  * info.ndim = ndim
6157  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6158  * # Allocate new buffer for strides and shape info.
6159  * # This is allocated as one block, strides first.
6160  */
6161  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6162  if (__pyx_t_1) {
6163 
6164  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
6165  * # Allocate new buffer for strides and shape info.
6166  * # This is allocated as one block, strides first.
6167  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
6168  * info.shape = info.strides + ndim
6169  * for i in range(ndim):
6170  */
6171  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
6172 
6173  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":241
6174  * # This is allocated as one block, strides first.
6175  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6176  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
6177  * for i in range(ndim):
6178  * info.strides[i] = PyArray_STRIDES(self)[i]
6179  */
6180  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
6181 
6182  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
6183  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6184  * info.shape = info.strides + ndim
6185  * for i in range(ndim): # <<<<<<<<<<<<<<
6186  * info.strides[i] = PyArray_STRIDES(self)[i]
6187  * info.shape[i] = PyArray_DIMS(self)[i]
6188  */
6189  __pyx_t_4 = __pyx_v_ndim;
6190  __pyx_t_5 = __pyx_t_4;
6191  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6192  __pyx_v_i = __pyx_t_6;
6193 
6194  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
6195  * info.shape = info.strides + ndim
6196  * for i in range(ndim):
6197  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
6198  * info.shape[i] = PyArray_DIMS(self)[i]
6199  * else:
6200  */
6201  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
6202 
6203  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
6204  * for i in range(ndim):
6205  * info.strides[i] = PyArray_STRIDES(self)[i]
6206  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
6207  * else:
6208  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6209  */
6210  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
6211  }
6212 
6213  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
6214  * info.buf = PyArray_DATA(self)
6215  * info.ndim = ndim
6216  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6217  * # Allocate new buffer for strides and shape info.
6218  * # This is allocated as one block, strides first.
6219  */
6220  goto __pyx_L9;
6221  }
6222 
6223  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
6224  * info.shape[i] = PyArray_DIMS(self)[i]
6225  * else:
6226  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
6227  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6228  * info.suboffsets = NULL
6229  */
6230  /*else*/ {
6231  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
6232 
6233  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247
6234  * else:
6235  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6236  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
6237  * info.suboffsets = NULL
6238  * info.itemsize = PyArray_ITEMSIZE(self)
6239  */
6240  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
6241  }
6242  __pyx_L9:;
6243 
6244  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
6245  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6246  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6247  * info.suboffsets = NULL # <<<<<<<<<<<<<<
6248  * info.itemsize = PyArray_ITEMSIZE(self)
6249  * info.readonly = not PyArray_ISWRITEABLE(self)
6250  */
6251  __pyx_v_info->suboffsets = NULL;
6252 
6253  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249
6254  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6255  * info.suboffsets = NULL
6256  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
6257  * info.readonly = not PyArray_ISWRITEABLE(self)
6258  *
6259  */
6260  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
6261 
6262  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250
6263  * info.suboffsets = NULL
6264  * info.itemsize = PyArray_ITEMSIZE(self)
6265  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
6266  *
6267  * cdef int t
6268  */
6269  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
6270 
6271  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
6272  *
6273  * cdef int t
6274  * cdef char* f = NULL # <<<<<<<<<<<<<<
6275  * cdef dtype descr = self.descr
6276  * cdef int offset
6277  */
6278  __pyx_v_f = NULL;
6279 
6280  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
6281  * cdef int t
6282  * cdef char* f = NULL
6283  * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
6284  * cdef int offset
6285  *
6286  */
6287  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
6288  __Pyx_INCREF(__pyx_t_3);
6289  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
6290  __pyx_t_3 = 0;
6291 
6292  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
6293  * cdef int offset
6294  *
6295  * info.obj = self # <<<<<<<<<<<<<<
6296  *
6297  * if not PyDataType_HASFIELDS(descr):
6298  */
6299  __Pyx_INCREF(((PyObject *)__pyx_v_self));
6300  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6301  __Pyx_GOTREF(__pyx_v_info->obj);
6302  __Pyx_DECREF(__pyx_v_info->obj);
6303  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6304 
6305  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
6306  * info.obj = self
6307  *
6308  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6309  * t = descr.type_num
6310  * if ((descr.byteorder == c'>' and little_endian) or
6311  */
6312  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
6313  if (__pyx_t_1) {
6314 
6315  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
6316  *
6317  * if not PyDataType_HASFIELDS(descr):
6318  * t = descr.type_num # <<<<<<<<<<<<<<
6319  * if ((descr.byteorder == c'>' and little_endian) or
6320  * (descr.byteorder == c'<' and not little_endian)):
6321  */
6322  __pyx_t_4 = __pyx_v_descr->type_num;
6323  __pyx_v_t = __pyx_t_4;
6324 
6325  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
6326  * if not PyDataType_HASFIELDS(descr):
6327  * t = descr.type_num
6328  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6329  * (descr.byteorder == c'<' and not little_endian)):
6330  * raise ValueError(u"Non-native byte order not supported")
6331  */
6332  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
6333  if (!__pyx_t_2) {
6334  goto __pyx_L15_next_or;
6335  } else {
6336  }
6337  __pyx_t_2 = (__pyx_v_little_endian != 0);
6338  if (!__pyx_t_2) {
6339  } else {
6340  __pyx_t_1 = __pyx_t_2;
6341  goto __pyx_L14_bool_binop_done;
6342  }
6343  __pyx_L15_next_or:;
6344 
6345  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
6346  * t = descr.type_num
6347  * if ((descr.byteorder == c'>' and little_endian) or
6348  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
6349  * raise ValueError(u"Non-native byte order not supported")
6350  * if t == NPY_BYTE: f = "b"
6351  */
6352  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
6353  if (__pyx_t_2) {
6354  } else {
6355  __pyx_t_1 = __pyx_t_2;
6356  goto __pyx_L14_bool_binop_done;
6357  }
6358  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
6359  __pyx_t_1 = __pyx_t_2;
6360  __pyx_L14_bool_binop_done:;
6361 
6362  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
6363  * if not PyDataType_HASFIELDS(descr):
6364  * t = descr.type_num
6365  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6366  * (descr.byteorder == c'<' and not little_endian)):
6367  * raise ValueError(u"Non-native byte order not supported")
6368  */
6369  if (unlikely(__pyx_t_1)) {
6370 
6371  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
6372  * if ((descr.byteorder == c'>' and little_endian) or
6373  * (descr.byteorder == c'<' and not little_endian)):
6374  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6375  * if t == NPY_BYTE: f = "b"
6376  * elif t == NPY_UBYTE: f = "B"
6377  */
6378  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 263, __pyx_L1_error)
6379  __Pyx_GOTREF(__pyx_t_3);
6380  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6381  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6382  __PYX_ERR(2, 263, __pyx_L1_error)
6383 
6384  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
6385  * if not PyDataType_HASFIELDS(descr):
6386  * t = descr.type_num
6387  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6388  * (descr.byteorder == c'<' and not little_endian)):
6389  * raise ValueError(u"Non-native byte order not supported")
6390  */
6391  }
6392 
6393  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
6394  * (descr.byteorder == c'<' and not little_endian)):
6395  * raise ValueError(u"Non-native byte order not supported")
6396  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
6397  * elif t == NPY_UBYTE: f = "B"
6398  * elif t == NPY_SHORT: f = "h"
6399  */
6400  switch (__pyx_v_t) {
6401  case NPY_BYTE:
6402  __pyx_v_f = ((char *)"b");
6403  break;
6404 
6405  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
6406  * raise ValueError(u"Non-native byte order not supported")
6407  * if t == NPY_BYTE: f = "b"
6408  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
6409  * elif t == NPY_SHORT: f = "h"
6410  * elif t == NPY_USHORT: f = "H"
6411  */
6412  case NPY_UBYTE:
6413  __pyx_v_f = ((char *)"B");
6414  break;
6415 
6416  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
6417  * if t == NPY_BYTE: f = "b"
6418  * elif t == NPY_UBYTE: f = "B"
6419  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
6420  * elif t == NPY_USHORT: f = "H"
6421  * elif t == NPY_INT: f = "i"
6422  */
6423  case NPY_SHORT:
6424  __pyx_v_f = ((char *)"h");
6425  break;
6426 
6427  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
6428  * elif t == NPY_UBYTE: f = "B"
6429  * elif t == NPY_SHORT: f = "h"
6430  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
6431  * elif t == NPY_INT: f = "i"
6432  * elif t == NPY_UINT: f = "I"
6433  */
6434  case NPY_USHORT:
6435  __pyx_v_f = ((char *)"H");
6436  break;
6437 
6438  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
6439  * elif t == NPY_SHORT: f = "h"
6440  * elif t == NPY_USHORT: f = "H"
6441  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
6442  * elif t == NPY_UINT: f = "I"
6443  * elif t == NPY_LONG: f = "l"
6444  */
6445  case NPY_INT:
6446  __pyx_v_f = ((char *)"i");
6447  break;
6448 
6449  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
6450  * elif t == NPY_USHORT: f = "H"
6451  * elif t == NPY_INT: f = "i"
6452  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
6453  * elif t == NPY_LONG: f = "l"
6454  * elif t == NPY_ULONG: f = "L"
6455  */
6456  case NPY_UINT:
6457  __pyx_v_f = ((char *)"I");
6458  break;
6459 
6460  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6461  * elif t == NPY_INT: f = "i"
6462  * elif t == NPY_UINT: f = "I"
6463  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
6464  * elif t == NPY_ULONG: f = "L"
6465  * elif t == NPY_LONGLONG: f = "q"
6466  */
6467  case NPY_LONG:
6468  __pyx_v_f = ((char *)"l");
6469  break;
6470 
6471  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
6472  * elif t == NPY_UINT: f = "I"
6473  * elif t == NPY_LONG: f = "l"
6474  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
6475  * elif t == NPY_LONGLONG: f = "q"
6476  * elif t == NPY_ULONGLONG: f = "Q"
6477  */
6478  case NPY_ULONG:
6479  __pyx_v_f = ((char *)"L");
6480  break;
6481 
6482  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
6483  * elif t == NPY_LONG: f = "l"
6484  * elif t == NPY_ULONG: f = "L"
6485  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
6486  * elif t == NPY_ULONGLONG: f = "Q"
6487  * elif t == NPY_FLOAT: f = "f"
6488  */
6489  case NPY_LONGLONG:
6490  __pyx_v_f = ((char *)"q");
6491  break;
6492 
6493  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
6494  * elif t == NPY_ULONG: f = "L"
6495  * elif t == NPY_LONGLONG: f = "q"
6496  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
6497  * elif t == NPY_FLOAT: f = "f"
6498  * elif t == NPY_DOUBLE: f = "d"
6499  */
6500  case NPY_ULONGLONG:
6501  __pyx_v_f = ((char *)"Q");
6502  break;
6503 
6504  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6505  * elif t == NPY_LONGLONG: f = "q"
6506  * elif t == NPY_ULONGLONG: f = "Q"
6507  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
6508  * elif t == NPY_DOUBLE: f = "d"
6509  * elif t == NPY_LONGDOUBLE: f = "g"
6510  */
6511  case NPY_FLOAT:
6512  __pyx_v_f = ((char *)"f");
6513  break;
6514 
6515  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
6516  * elif t == NPY_ULONGLONG: f = "Q"
6517  * elif t == NPY_FLOAT: f = "f"
6518  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
6519  * elif t == NPY_LONGDOUBLE: f = "g"
6520  * elif t == NPY_CFLOAT: f = "Zf"
6521  */
6522  case NPY_DOUBLE:
6523  __pyx_v_f = ((char *)"d");
6524  break;
6525 
6526  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
6527  * elif t == NPY_FLOAT: f = "f"
6528  * elif t == NPY_DOUBLE: f = "d"
6529  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
6530  * elif t == NPY_CFLOAT: f = "Zf"
6531  * elif t == NPY_CDOUBLE: f = "Zd"
6532  */
6533  case NPY_LONGDOUBLE:
6534  __pyx_v_f = ((char *)"g");
6535  break;
6536 
6537  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
6538  * elif t == NPY_DOUBLE: f = "d"
6539  * elif t == NPY_LONGDOUBLE: f = "g"
6540  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
6541  * elif t == NPY_CDOUBLE: f = "Zd"
6542  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6543  */
6544  case NPY_CFLOAT:
6545  __pyx_v_f = ((char *)"Zf");
6546  break;
6547 
6548  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
6549  * elif t == NPY_LONGDOUBLE: f = "g"
6550  * elif t == NPY_CFLOAT: f = "Zf"
6551  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
6552  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6553  * elif t == NPY_OBJECT: f = "O"
6554  */
6555  case NPY_CDOUBLE:
6556  __pyx_v_f = ((char *)"Zd");
6557  break;
6558 
6559  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
6560  * elif t == NPY_CFLOAT: f = "Zf"
6561  * elif t == NPY_CDOUBLE: f = "Zd"
6562  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
6563  * elif t == NPY_OBJECT: f = "O"
6564  * else:
6565  */
6566  case NPY_CLONGDOUBLE:
6567  __pyx_v_f = ((char *)"Zg");
6568  break;
6569 
6570  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6571  * elif t == NPY_CDOUBLE: f = "Zd"
6572  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6573  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
6574  * else:
6575  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6576  */
6577  case NPY_OBJECT:
6578  __pyx_v_f = ((char *)"O");
6579  break;
6580  default:
6581 
6582  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
6583  * elif t == NPY_OBJECT: f = "O"
6584  * else:
6585  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
6586  * info.format = f
6587  * return
6588  */
6589  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error)
6590  __Pyx_GOTREF(__pyx_t_3);
6591  __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 282, __pyx_L1_error)
6592  __Pyx_GOTREF(__pyx_t_7);
6593  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6594  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error)
6595  __Pyx_GOTREF(__pyx_t_3);
6596  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6597  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6598  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6599  __PYX_ERR(2, 282, __pyx_L1_error)
6600  break;
6601  }
6602 
6603  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
6604  * else:
6605  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6606  * info.format = f # <<<<<<<<<<<<<<
6607  * return
6608  * else:
6609  */
6610  __pyx_v_info->format = __pyx_v_f;
6611 
6612  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
6613  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6614  * info.format = f
6615  * return # <<<<<<<<<<<<<<
6616  * else:
6617  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6618  */
6619  __pyx_r = 0;
6620  goto __pyx_L0;
6621 
6622  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
6623  * info.obj = self
6624  *
6625  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6626  * t = descr.type_num
6627  * if ((descr.byteorder == c'>' and little_endian) or
6628  */
6629  }
6630 
6631  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
6632  * return
6633  * else:
6634  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
6635  * info.format[0] = c'^' # Native data types, manual alignment
6636  * offset = 0
6637  */
6638  /*else*/ {
6639  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
6640 
6641  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
6642  * else:
6643  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6644  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
6645  * offset = 0
6646  * f = _util_dtypestring(descr, info.format + 1,
6647  */
6648  (__pyx_v_info->format[0]) = '^';
6649 
6650  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
6651  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6652  * info.format[0] = c'^' # Native data types, manual alignment
6653  * offset = 0 # <<<<<<<<<<<<<<
6654  * f = _util_dtypestring(descr, info.format + 1,
6655  * info.format + _buffer_format_string_len,
6656  */
6657  __pyx_v_offset = 0;
6658 
6659  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
6660  * info.format[0] = c'^' # Native data types, manual alignment
6661  * offset = 0
6662  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
6663  * info.format + _buffer_format_string_len,
6664  * &offset)
6665  */
6666  __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(2, 289, __pyx_L1_error)
6667  __pyx_v_f = __pyx_t_8;
6668 
6669  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
6670  * info.format + _buffer_format_string_len,
6671  * &offset)
6672  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
6673  *
6674  * def __releasebuffer__(ndarray self, Py_buffer* info):
6675  */
6676  (__pyx_v_f[0]) = '\x00';
6677  }
6678 
6679  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
6680  * # experimental exception made for __getbuffer__ and __releasebuffer__
6681  * # -- the details of this may change.
6682  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6683  * # This implementation of getbuffer is geared towards Cython
6684  * # requirements, and does not yet fulfill the PEP.
6685  */
6686 
6687  /* function exit code */
6688  __pyx_r = 0;
6689  goto __pyx_L0;
6690  __pyx_L1_error:;
6691  __Pyx_XDECREF(__pyx_t_3);
6692  __Pyx_XDECREF(__pyx_t_7);
6693  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6694  __pyx_r = -1;
6695  if (__pyx_v_info->obj != NULL) {
6696  __Pyx_GOTREF(__pyx_v_info->obj);
6697  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6698  }
6699  goto __pyx_L2;
6700  __pyx_L0:;
6701  if (__pyx_v_info->obj == Py_None) {
6702  __Pyx_GOTREF(__pyx_v_info->obj);
6703  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6704  }
6705  __pyx_L2:;
6706  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
6707  __Pyx_RefNannyFinishContext();
6708  return __pyx_r;
6709 }
6710 
6711 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
6712  * f[0] = c'\0' # Terminate format string
6713  *
6714  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6715  * if PyArray_HASFIELDS(self):
6716  * PyObject_Free(info.format)
6717  */
6718 
6719 /* Python wrapper */
6720 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
6721 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6722  __Pyx_RefNannyDeclarations
6723  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
6724  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
6725 
6726  /* function exit code */
6727  __Pyx_RefNannyFinishContext();
6728 }
6729 
6730 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6731  __Pyx_RefNannyDeclarations
6732  int __pyx_t_1;
6733  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
6734 
6735  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295
6736  *
6737  * def __releasebuffer__(ndarray self, Py_buffer* info):
6738  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6739  * PyObject_Free(info.format)
6740  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6741  */
6742  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
6743  if (__pyx_t_1) {
6744 
6745  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
6746  * def __releasebuffer__(ndarray self, Py_buffer* info):
6747  * if PyArray_HASFIELDS(self):
6748  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
6749  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6750  * PyObject_Free(info.strides)
6751  */
6752  PyObject_Free(__pyx_v_info->format);
6753 
6754  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295
6755  *
6756  * def __releasebuffer__(ndarray self, Py_buffer* info):
6757  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6758  * PyObject_Free(info.format)
6759  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6760  */
6761  }
6762 
6763  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6764  * if PyArray_HASFIELDS(self):
6765  * PyObject_Free(info.format)
6766  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6767  * PyObject_Free(info.strides)
6768  * # info.shape was stored after info.strides in the same block
6769  */
6770  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6771  if (__pyx_t_1) {
6772 
6773  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":298
6774  * PyObject_Free(info.format)
6775  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6776  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
6777  * # info.shape was stored after info.strides in the same block
6778  *
6779  */
6780  PyObject_Free(__pyx_v_info->strides);
6781 
6782  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6783  * if PyArray_HASFIELDS(self):
6784  * PyObject_Free(info.format)
6785  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6786  * PyObject_Free(info.strides)
6787  * # info.shape was stored after info.strides in the same block
6788  */
6789  }
6790 
6791  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
6792  * f[0] = c'\0' # Terminate format string
6793  *
6794  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6795  * if PyArray_HASFIELDS(self):
6796  * PyObject_Free(info.format)
6797  */
6798 
6799  /* function exit code */
6800  __Pyx_RefNannyFinishContext();
6801 }
6802 
6803 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
6804  * ctypedef npy_cdouble complex_t
6805  *
6806  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6807  * return PyArray_MultiIterNew(1, <void*>a)
6808  *
6809  */
6810 
6811 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6812  PyObject *__pyx_r = NULL;
6813  __Pyx_RefNannyDeclarations
6814  PyObject *__pyx_t_1 = NULL;
6815  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6816 
6817  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
6818  *
6819  * cdef inline object PyArray_MultiIterNew1(a):
6820  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6821  *
6822  * cdef inline object PyArray_MultiIterNew2(a, b):
6823  */
6824  __Pyx_XDECREF(__pyx_r);
6825  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 776, __pyx_L1_error)
6826  __Pyx_GOTREF(__pyx_t_1);
6827  __pyx_r = __pyx_t_1;
6828  __pyx_t_1 = 0;
6829  goto __pyx_L0;
6830 
6831  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
6832  * ctypedef npy_cdouble complex_t
6833  *
6834  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6835  * return PyArray_MultiIterNew(1, <void*>a)
6836  *
6837  */
6838 
6839  /* function exit code */
6840  __pyx_L1_error:;
6841  __Pyx_XDECREF(__pyx_t_1);
6842  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6843  __pyx_r = 0;
6844  __pyx_L0:;
6845  __Pyx_XGIVEREF(__pyx_r);
6846  __Pyx_RefNannyFinishContext();
6847  return __pyx_r;
6848 }
6849 
6850 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
6851  * return PyArray_MultiIterNew(1, <void*>a)
6852  *
6853  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6854  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6855  *
6856  */
6857 
6858 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6859  PyObject *__pyx_r = NULL;
6860  __Pyx_RefNannyDeclarations
6861  PyObject *__pyx_t_1 = NULL;
6862  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6863 
6864  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
6865  *
6866  * cdef inline object PyArray_MultiIterNew2(a, b):
6867  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6868  *
6869  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6870  */
6871  __Pyx_XDECREF(__pyx_r);
6872  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 779, __pyx_L1_error)
6873  __Pyx_GOTREF(__pyx_t_1);
6874  __pyx_r = __pyx_t_1;
6875  __pyx_t_1 = 0;
6876  goto __pyx_L0;
6877 
6878  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
6879  * return PyArray_MultiIterNew(1, <void*>a)
6880  *
6881  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6882  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6883  *
6884  */
6885 
6886  /* function exit code */
6887  __pyx_L1_error:;
6888  __Pyx_XDECREF(__pyx_t_1);
6889  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6890  __pyx_r = 0;
6891  __pyx_L0:;
6892  __Pyx_XGIVEREF(__pyx_r);
6893  __Pyx_RefNannyFinishContext();
6894  return __pyx_r;
6895 }
6896 
6897 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
6898  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6899  *
6900  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6901  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6902  *
6903  */
6904 
6905 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6906  PyObject *__pyx_r = NULL;
6907  __Pyx_RefNannyDeclarations
6908  PyObject *__pyx_t_1 = NULL;
6909  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6910 
6911  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
6912  *
6913  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6914  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6915  *
6916  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6917  */
6918  __Pyx_XDECREF(__pyx_r);
6919  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 782, __pyx_L1_error)
6920  __Pyx_GOTREF(__pyx_t_1);
6921  __pyx_r = __pyx_t_1;
6922  __pyx_t_1 = 0;
6923  goto __pyx_L0;
6924 
6925  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
6926  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6927  *
6928  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6929  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6930  *
6931  */
6932 
6933  /* function exit code */
6934  __pyx_L1_error:;
6935  __Pyx_XDECREF(__pyx_t_1);
6936  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6937  __pyx_r = 0;
6938  __pyx_L0:;
6939  __Pyx_XGIVEREF(__pyx_r);
6940  __Pyx_RefNannyFinishContext();
6941  return __pyx_r;
6942 }
6943 
6944 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
6945  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6946  *
6947  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6948  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6949  *
6950  */
6951 
6952 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6953  PyObject *__pyx_r = NULL;
6954  __Pyx_RefNannyDeclarations
6955  PyObject *__pyx_t_1 = NULL;
6956  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6957 
6958  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
6959  *
6960  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6961  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6962  *
6963  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6964  */
6965  __Pyx_XDECREF(__pyx_r);
6966  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 785, __pyx_L1_error)
6967  __Pyx_GOTREF(__pyx_t_1);
6968  __pyx_r = __pyx_t_1;
6969  __pyx_t_1 = 0;
6970  goto __pyx_L0;
6971 
6972  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
6973  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6974  *
6975  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6976  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6977  *
6978  */
6979 
6980  /* function exit code */
6981  __pyx_L1_error:;
6982  __Pyx_XDECREF(__pyx_t_1);
6983  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6984  __pyx_r = 0;
6985  __pyx_L0:;
6986  __Pyx_XGIVEREF(__pyx_r);
6987  __Pyx_RefNannyFinishContext();
6988  return __pyx_r;
6989 }
6990 
6991 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":787
6992  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6993  *
6994  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6995  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6996  *
6997  */
6998 
6999 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7000  PyObject *__pyx_r = NULL;
7001  __Pyx_RefNannyDeclarations
7002  PyObject *__pyx_t_1 = NULL;
7003  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7004 
7005  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":788
7006  *
7007  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7008  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7009  *
7010  * cdef inline tuple PyDataType_SHAPE(dtype d):
7011  */
7012  __Pyx_XDECREF(__pyx_r);
7013  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 788, __pyx_L1_error)
7014  __Pyx_GOTREF(__pyx_t_1);
7015  __pyx_r = __pyx_t_1;
7016  __pyx_t_1 = 0;
7017  goto __pyx_L0;
7018 
7019  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":787
7020  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7021  *
7022  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7023  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7024  *
7025  */
7026 
7027  /* function exit code */
7028  __pyx_L1_error:;
7029  __Pyx_XDECREF(__pyx_t_1);
7030  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7031  __pyx_r = 0;
7032  __pyx_L0:;
7033  __Pyx_XGIVEREF(__pyx_r);
7034  __Pyx_RefNannyFinishContext();
7035  return __pyx_r;
7036 }
7037 
7038 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
7039  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7040  *
7041  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7042  * if PyDataType_HASSUBARRAY(d):
7043  * return <tuple>d.subarray.shape
7044  */
7045 
7046 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7047  PyObject *__pyx_r = NULL;
7048  __Pyx_RefNannyDeclarations
7049  int __pyx_t_1;
7050  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7051 
7052  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
7053  *
7054  * cdef inline tuple PyDataType_SHAPE(dtype d):
7055  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7056  * return <tuple>d.subarray.shape
7057  * else:
7058  */
7059  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7060  if (__pyx_t_1) {
7061 
7062  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":792
7063  * cdef inline tuple PyDataType_SHAPE(dtype d):
7064  * if PyDataType_HASSUBARRAY(d):
7065  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7066  * else:
7067  * return ()
7068  */
7069  __Pyx_XDECREF(__pyx_r);
7070  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7071  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7072  goto __pyx_L0;
7073 
7074  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
7075  *
7076  * cdef inline tuple PyDataType_SHAPE(dtype d):
7077  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7078  * return <tuple>d.subarray.shape
7079  * else:
7080  */
7081  }
7082 
7083  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
7084  * return <tuple>d.subarray.shape
7085  * else:
7086  * return () # <<<<<<<<<<<<<<
7087  *
7088  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
7089  */
7090  /*else*/ {
7091  __Pyx_XDECREF(__pyx_r);
7092  __Pyx_INCREF(__pyx_empty_tuple);
7093  __pyx_r = __pyx_empty_tuple;
7094  goto __pyx_L0;
7095  }
7096 
7097  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
7098  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7099  *
7100  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7101  * if PyDataType_HASSUBARRAY(d):
7102  * return <tuple>d.subarray.shape
7103  */
7104 
7105  /* function exit code */
7106  __pyx_L0:;
7107  __Pyx_XGIVEREF(__pyx_r);
7108  __Pyx_RefNannyFinishContext();
7109  return __pyx_r;
7110 }
7111 
7112 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
7113  * return ()
7114  *
7115  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7116  * # Recursive utility function used in __getbuffer__ to get format
7117  * # string. The new location in the format string is returned.
7118  */
7119 
7120 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
7121  PyArray_Descr *__pyx_v_child = 0;
7122  int __pyx_v_endian_detector;
7123  int __pyx_v_little_endian;
7124  PyObject *__pyx_v_fields = 0;
7125  PyObject *__pyx_v_childname = NULL;
7126  PyObject *__pyx_v_new_offset = NULL;
7127  PyObject *__pyx_v_t = NULL;
7128  char *__pyx_r;
7129  __Pyx_RefNannyDeclarations
7130  PyObject *__pyx_t_1 = NULL;
7131  Py_ssize_t __pyx_t_2;
7132  PyObject *__pyx_t_3 = NULL;
7133  PyObject *__pyx_t_4 = NULL;
7134  int __pyx_t_5;
7135  int __pyx_t_6;
7136  int __pyx_t_7;
7137  long __pyx_t_8;
7138  char *__pyx_t_9;
7139  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
7140 
7141  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
7142  *
7143  * cdef dtype child
7144  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
7145  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7146  * cdef tuple fields
7147  */
7148  __pyx_v_endian_detector = 1;
7149 
7150  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
7151  * cdef dtype child
7152  * cdef int endian_detector = 1
7153  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
7154  * cdef tuple fields
7155  *
7156  */
7157  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
7158 
7159  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
7160  * cdef tuple fields
7161  *
7162  * for childname in descr.names: # <<<<<<<<<<<<<<
7163  * fields = descr.fields[childname]
7164  * child, new_offset = fields
7165  */
7166  if (unlikely(__pyx_v_descr->names == Py_None)) {
7167  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7168  __PYX_ERR(2, 805, __pyx_L1_error)
7169  }
7170  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7171  for (;;) {
7172  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7173  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7174  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 805, __pyx_L1_error)
7175  #else
7176  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 805, __pyx_L1_error)
7177  __Pyx_GOTREF(__pyx_t_3);
7178  #endif
7179  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7180  __pyx_t_3 = 0;
7181 
7182  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
7183  *
7184  * for childname in descr.names:
7185  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
7186  * child, new_offset = fields
7187  *
7188  */
7189  if (unlikely(__pyx_v_descr->fields == Py_None)) {
7190  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7191  __PYX_ERR(2, 806, __pyx_L1_error)
7192  }
7193  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 806, __pyx_L1_error)
7194  __Pyx_GOTREF(__pyx_t_3);
7195  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 806, __pyx_L1_error)
7196  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
7197  __pyx_t_3 = 0;
7198 
7199  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":807
7200  * for childname in descr.names:
7201  * fields = descr.fields[childname]
7202  * child, new_offset = fields # <<<<<<<<<<<<<<
7203  *
7204  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7205  */
7206  if (likely(__pyx_v_fields != Py_None)) {
7207  PyObject* sequence = __pyx_v_fields;
7208  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7209  if (unlikely(size != 2)) {
7210  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7211  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7212  __PYX_ERR(2, 807, __pyx_L1_error)
7213  }
7214  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7215  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7216  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7217  __Pyx_INCREF(__pyx_t_3);
7218  __Pyx_INCREF(__pyx_t_4);
7219  #else
7220  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 807, __pyx_L1_error)
7221  __Pyx_GOTREF(__pyx_t_3);
7222  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 807, __pyx_L1_error)
7223  __Pyx_GOTREF(__pyx_t_4);
7224  #endif
7225  } else {
7226  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 807, __pyx_L1_error)
7227  }
7228  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 807, __pyx_L1_error)
7229  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7230  __pyx_t_3 = 0;
7231  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7232  __pyx_t_4 = 0;
7233 
7234  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
7235  * child, new_offset = fields
7236  *
7237  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7238  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7239  *
7240  */
7241  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 809, __pyx_L1_error)
7242  __Pyx_GOTREF(__pyx_t_4);
7243  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 809, __pyx_L1_error)
7244  __Pyx_GOTREF(__pyx_t_3);
7245  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7246  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 809, __pyx_L1_error)
7247  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7248  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
7249  if (unlikely(__pyx_t_6)) {
7250 
7251  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":810
7252  *
7253  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7254  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
7255  *
7256  * if ((child.byteorder == c'>' and little_endian) or
7257  */
7258  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 810, __pyx_L1_error)
7259  __Pyx_GOTREF(__pyx_t_3);
7260  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7261  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7262  __PYX_ERR(2, 810, __pyx_L1_error)
7263 
7264  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
7265  * child, new_offset = fields
7266  *
7267  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7268  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7269  *
7270  */
7271  }
7272 
7273  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
7274  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7275  *
7276  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7277  * (child.byteorder == c'<' and not little_endian)):
7278  * raise ValueError(u"Non-native byte order not supported")
7279  */
7280  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
7281  if (!__pyx_t_7) {
7282  goto __pyx_L8_next_or;
7283  } else {
7284  }
7285  __pyx_t_7 = (__pyx_v_little_endian != 0);
7286  if (!__pyx_t_7) {
7287  } else {
7288  __pyx_t_6 = __pyx_t_7;
7289  goto __pyx_L7_bool_binop_done;
7290  }
7291  __pyx_L8_next_or:;
7292 
7293  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
7294  *
7295  * if ((child.byteorder == c'>' and little_endian) or
7296  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7297  * raise ValueError(u"Non-native byte order not supported")
7298  * # One could encode it in the format string and have Cython
7299  */
7300  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
7301  if (__pyx_t_7) {
7302  } else {
7303  __pyx_t_6 = __pyx_t_7;
7304  goto __pyx_L7_bool_binop_done;
7305  }
7306  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7307  __pyx_t_6 = __pyx_t_7;
7308  __pyx_L7_bool_binop_done:;
7309 
7310  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
7311  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7312  *
7313  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7314  * (child.byteorder == c'<' and not little_endian)):
7315  * raise ValueError(u"Non-native byte order not supported")
7316  */
7317  if (unlikely(__pyx_t_6)) {
7318 
7319  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
7320  * if ((child.byteorder == c'>' and little_endian) or
7321  * (child.byteorder == c'<' and not little_endian)):
7322  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7323  * # One could encode it in the format string and have Cython
7324  * # complain instead, BUT: < and > in format strings also imply
7325  */
7326  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 814, __pyx_L1_error)
7327  __Pyx_GOTREF(__pyx_t_3);
7328  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7329  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7330  __PYX_ERR(2, 814, __pyx_L1_error)
7331 
7332  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
7333  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7334  *
7335  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7336  * (child.byteorder == c'<' and not little_endian)):
7337  * raise ValueError(u"Non-native byte order not supported")
7338  */
7339  }
7340 
7341  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7342  *
7343  * # Output padding bytes
7344  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
7345  * f[0] = 120 # "x"; pad byte
7346  * f += 1
7347  */
7348  while (1) {
7349  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 824, __pyx_L1_error)
7350  __Pyx_GOTREF(__pyx_t_3);
7351  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 824, __pyx_L1_error)
7352  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7353  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 824, __pyx_L1_error)
7354  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7355  if (!__pyx_t_6) break;
7356 
7357  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
7358  * # Output padding bytes
7359  * while offset[0] < new_offset:
7360  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
7361  * f += 1
7362  * offset[0] += 1
7363  */
7364  (__pyx_v_f[0]) = 0x78;
7365 
7366  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
7367  * while offset[0] < new_offset:
7368  * f[0] = 120 # "x"; pad byte
7369  * f += 1 # <<<<<<<<<<<<<<
7370  * offset[0] += 1
7371  *
7372  */
7373  __pyx_v_f = (__pyx_v_f + 1);
7374 
7375  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7376  * f[0] = 120 # "x"; pad byte
7377  * f += 1
7378  * offset[0] += 1 # <<<<<<<<<<<<<<
7379  *
7380  * offset[0] += child.itemsize
7381  */
7382  __pyx_t_8 = 0;
7383  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7384  }
7385 
7386  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
7387  * offset[0] += 1
7388  *
7389  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
7390  *
7391  * if not PyDataType_HASFIELDS(child):
7392  */
7393  __pyx_t_8 = 0;
7394  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7395 
7396  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
7397  * offset[0] += child.itemsize
7398  *
7399  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7400  * t = child.type_num
7401  * if end - f < 5:
7402  */
7403  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7404  if (__pyx_t_6) {
7405 
7406  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
7407  *
7408  * if not PyDataType_HASFIELDS(child):
7409  * t = child.type_num # <<<<<<<<<<<<<<
7410  * if end - f < 5:
7411  * raise RuntimeError(u"Format string allocated too short.")
7412  */
7413  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error)
7414  __Pyx_GOTREF(__pyx_t_4);
7415  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7416  __pyx_t_4 = 0;
7417 
7418  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7419  * if not PyDataType_HASFIELDS(child):
7420  * t = child.type_num
7421  * if end - f < 5: # <<<<<<<<<<<<<<
7422  * raise RuntimeError(u"Format string allocated too short.")
7423  *
7424  */
7425  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7426  if (unlikely(__pyx_t_6)) {
7427 
7428  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
7429  * t = child.type_num
7430  * if end - f < 5:
7431  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
7432  *
7433  * # Until ticket #99 is fixed, use integers to avoid warnings
7434  */
7435  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error)
7436  __Pyx_GOTREF(__pyx_t_4);
7437  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7438  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7439  __PYX_ERR(2, 834, __pyx_L1_error)
7440 
7441  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7442  * if not PyDataType_HASFIELDS(child):
7443  * t = child.type_num
7444  * if end - f < 5: # <<<<<<<<<<<<<<
7445  * raise RuntimeError(u"Format string allocated too short.")
7446  *
7447  */
7448  }
7449 
7450  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7451  *
7452  * # Until ticket #99 is fixed, use integers to avoid warnings
7453  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
7454  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7455  * elif t == NPY_SHORT: f[0] = 104 #"h"
7456  */
7457  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error)
7458  __Pyx_GOTREF(__pyx_t_4);
7459  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error)
7460  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7461  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error)
7462  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7463  if (__pyx_t_6) {
7464  (__pyx_v_f[0]) = 98;
7465  goto __pyx_L15;
7466  }
7467 
7468  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
7469  * # Until ticket #99 is fixed, use integers to avoid warnings
7470  * if t == NPY_BYTE: f[0] = 98 #"b"
7471  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
7472  * elif t == NPY_SHORT: f[0] = 104 #"h"
7473  * elif t == NPY_USHORT: f[0] = 72 #"H"
7474  */
7475  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error)
7476  __Pyx_GOTREF(__pyx_t_3);
7477  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error)
7478  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7479  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error)
7480  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7481  if (__pyx_t_6) {
7482  (__pyx_v_f[0]) = 66;
7483  goto __pyx_L15;
7484  }
7485 
7486  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
7487  * if t == NPY_BYTE: f[0] = 98 #"b"
7488  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7489  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
7490  * elif t == NPY_USHORT: f[0] = 72 #"H"
7491  * elif t == NPY_INT: f[0] = 105 #"i"
7492  */
7493  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error)
7494  __Pyx_GOTREF(__pyx_t_4);
7495  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error)
7496  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7497  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error)
7498  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7499  if (__pyx_t_6) {
7500  (__pyx_v_f[0]) = 0x68;
7501  goto __pyx_L15;
7502  }
7503 
7504  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
7505  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7506  * elif t == NPY_SHORT: f[0] = 104 #"h"
7507  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
7508  * elif t == NPY_INT: f[0] = 105 #"i"
7509  * elif t == NPY_UINT: f[0] = 73 #"I"
7510  */
7511  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error)
7512  __Pyx_GOTREF(__pyx_t_3);
7513  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error)
7514  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7515  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error)
7516  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7517  if (__pyx_t_6) {
7518  (__pyx_v_f[0]) = 72;
7519  goto __pyx_L15;
7520  }
7521 
7522  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
7523  * elif t == NPY_SHORT: f[0] = 104 #"h"
7524  * elif t == NPY_USHORT: f[0] = 72 #"H"
7525  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
7526  * elif t == NPY_UINT: f[0] = 73 #"I"
7527  * elif t == NPY_LONG: f[0] = 108 #"l"
7528  */
7529  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error)
7530  __Pyx_GOTREF(__pyx_t_4);
7531  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error)
7532  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7533  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error)
7534  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7535  if (__pyx_t_6) {
7536  (__pyx_v_f[0]) = 0x69;
7537  goto __pyx_L15;
7538  }
7539 
7540  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
7541  * elif t == NPY_USHORT: f[0] = 72 #"H"
7542  * elif t == NPY_INT: f[0] = 105 #"i"
7543  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
7544  * elif t == NPY_LONG: f[0] = 108 #"l"
7545  * elif t == NPY_ULONG: f[0] = 76 #"L"
7546  */
7547  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error)
7548  __Pyx_GOTREF(__pyx_t_3);
7549  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error)
7550  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7551  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error)
7552  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7553  if (__pyx_t_6) {
7554  (__pyx_v_f[0]) = 73;
7555  goto __pyx_L15;
7556  }
7557 
7558  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843
7559  * elif t == NPY_INT: f[0] = 105 #"i"
7560  * elif t == NPY_UINT: f[0] = 73 #"I"
7561  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
7562  * elif t == NPY_ULONG: f[0] = 76 #"L"
7563  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7564  */
7565  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 843, __pyx_L1_error)
7566  __Pyx_GOTREF(__pyx_t_4);
7567  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 843, __pyx_L1_error)
7568  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7569  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 843, __pyx_L1_error)
7570  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7571  if (__pyx_t_6) {
7572  (__pyx_v_f[0]) = 0x6C;
7573  goto __pyx_L15;
7574  }
7575 
7576  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
7577  * elif t == NPY_UINT: f[0] = 73 #"I"
7578  * elif t == NPY_LONG: f[0] = 108 #"l"
7579  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
7580  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7581  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7582  */
7583  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error)
7584  __Pyx_GOTREF(__pyx_t_3);
7585  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error)
7586  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7587  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 844, __pyx_L1_error)
7588  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7589  if (__pyx_t_6) {
7590  (__pyx_v_f[0]) = 76;
7591  goto __pyx_L15;
7592  }
7593 
7594  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
7595  * elif t == NPY_LONG: f[0] = 108 #"l"
7596  * elif t == NPY_ULONG: f[0] = 76 #"L"
7597  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
7598  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7599  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7600  */
7601  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 845, __pyx_L1_error)
7602  __Pyx_GOTREF(__pyx_t_4);
7603  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 845, __pyx_L1_error)
7604  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7605  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 845, __pyx_L1_error)
7606  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7607  if (__pyx_t_6) {
7608  (__pyx_v_f[0]) = 0x71;
7609  goto __pyx_L15;
7610  }
7611 
7612  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":846
7613  * elif t == NPY_ULONG: f[0] = 76 #"L"
7614  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7615  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
7616  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7617  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7618  */
7619  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 846, __pyx_L1_error)
7620  __Pyx_GOTREF(__pyx_t_3);
7621  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 846, __pyx_L1_error)
7622  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7623  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 846, __pyx_L1_error)
7624  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7625  if (__pyx_t_6) {
7626  (__pyx_v_f[0]) = 81;
7627  goto __pyx_L15;
7628  }
7629 
7630  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
7631  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7632  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7633  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
7634  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7635  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7636  */
7637  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 847, __pyx_L1_error)
7638  __Pyx_GOTREF(__pyx_t_4);
7639  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 847, __pyx_L1_error)
7640  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7641  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 847, __pyx_L1_error)
7642  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7643  if (__pyx_t_6) {
7644  (__pyx_v_f[0]) = 0x66;
7645  goto __pyx_L15;
7646  }
7647 
7648  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
7649  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7650  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7651  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
7652  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7653  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7654  */
7655  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 848, __pyx_L1_error)
7656  __Pyx_GOTREF(__pyx_t_3);
7657  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 848, __pyx_L1_error)
7658  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7659  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 848, __pyx_L1_error)
7660  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7661  if (__pyx_t_6) {
7662  (__pyx_v_f[0]) = 0x64;
7663  goto __pyx_L15;
7664  }
7665 
7666  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
7667  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7668  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7669  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
7670  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7671  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7672  */
7673  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 849, __pyx_L1_error)
7674  __Pyx_GOTREF(__pyx_t_4);
7675  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 849, __pyx_L1_error)
7676  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7677  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 849, __pyx_L1_error)
7678  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7679  if (__pyx_t_6) {
7680  (__pyx_v_f[0]) = 0x67;
7681  goto __pyx_L15;
7682  }
7683 
7684  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
7685  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7686  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7687  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
7688  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7689  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7690  */
7691  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 850, __pyx_L1_error)
7692  __Pyx_GOTREF(__pyx_t_3);
7693  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 850, __pyx_L1_error)
7694  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7695  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 850, __pyx_L1_error)
7696  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7697  if (__pyx_t_6) {
7698  (__pyx_v_f[0]) = 90;
7699  (__pyx_v_f[1]) = 0x66;
7700  __pyx_v_f = (__pyx_v_f + 1);
7701  goto __pyx_L15;
7702  }
7703 
7704  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
7705  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7706  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7707  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
7708  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7709  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7710  */
7711  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 851, __pyx_L1_error)
7712  __Pyx_GOTREF(__pyx_t_4);
7713  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
7714  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7715  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
7716  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7717  if (__pyx_t_6) {
7718  (__pyx_v_f[0]) = 90;
7719  (__pyx_v_f[1]) = 0x64;
7720  __pyx_v_f = (__pyx_v_f + 1);
7721  goto __pyx_L15;
7722  }
7723 
7724  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
7725  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7726  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7727  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
7728  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7729  * else:
7730  */
7731  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
7732  __Pyx_GOTREF(__pyx_t_3);
7733  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 852, __pyx_L1_error)
7734  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7735  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 852, __pyx_L1_error)
7736  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7737  if (__pyx_t_6) {
7738  (__pyx_v_f[0]) = 90;
7739  (__pyx_v_f[1]) = 0x67;
7740  __pyx_v_f = (__pyx_v_f + 1);
7741  goto __pyx_L15;
7742  }
7743 
7744  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
7745  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7746  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7747  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
7748  * else:
7749  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7750  */
7751  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
7752  __Pyx_GOTREF(__pyx_t_4);
7753  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
7754  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7755  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 853, __pyx_L1_error)
7756  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7757  if (likely(__pyx_t_6)) {
7758  (__pyx_v_f[0]) = 79;
7759  goto __pyx_L15;
7760  }
7761 
7762  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7763  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7764  * else:
7765  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7766  * f += 1
7767  * else:
7768  */
7769  /*else*/ {
7770  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
7771  __Pyx_GOTREF(__pyx_t_3);
7772  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
7773  __Pyx_GOTREF(__pyx_t_4);
7774  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7775  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7776  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7777  __PYX_ERR(2, 855, __pyx_L1_error)
7778  }
7779  __pyx_L15:;
7780 
7781  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
7782  * else:
7783  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7784  * f += 1 # <<<<<<<<<<<<<<
7785  * else:
7786  * # Cython ignores struct boundary information ("T{...}"),
7787  */
7788  __pyx_v_f = (__pyx_v_f + 1);
7789 
7790  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
7791  * offset[0] += child.itemsize
7792  *
7793  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7794  * t = child.type_num
7795  * if end - f < 5:
7796  */
7797  goto __pyx_L13;
7798  }
7799 
7800  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
7801  * # Cython ignores struct boundary information ("T{...}"),
7802  * # so don't output it
7803  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
7804  * return f
7805  *
7806  */
7807  /*else*/ {
7808  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 860, __pyx_L1_error)
7809  __pyx_v_f = __pyx_t_9;
7810  }
7811  __pyx_L13:;
7812 
7813  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
7814  * cdef tuple fields
7815  *
7816  * for childname in descr.names: # <<<<<<<<<<<<<<
7817  * fields = descr.fields[childname]
7818  * child, new_offset = fields
7819  */
7820  }
7821  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7822 
7823  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":861
7824  * # so don't output it
7825  * f = _util_dtypestring(child, f, end, offset)
7826  * return f # <<<<<<<<<<<<<<
7827  *
7828  *
7829  */
7830  __pyx_r = __pyx_v_f;
7831  goto __pyx_L0;
7832 
7833  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
7834  * return ()
7835  *
7836  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7837  * # Recursive utility function used in __getbuffer__ to get format
7838  * # string. The new location in the format string is returned.
7839  */
7840 
7841  /* function exit code */
7842  __pyx_L1_error:;
7843  __Pyx_XDECREF(__pyx_t_1);
7844  __Pyx_XDECREF(__pyx_t_3);
7845  __Pyx_XDECREF(__pyx_t_4);
7846  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7847  __pyx_r = NULL;
7848  __pyx_L0:;
7849  __Pyx_XDECREF((PyObject *)__pyx_v_child);
7850  __Pyx_XDECREF(__pyx_v_fields);
7851  __Pyx_XDECREF(__pyx_v_childname);
7852  __Pyx_XDECREF(__pyx_v_new_offset);
7853  __Pyx_XDECREF(__pyx_v_t);
7854  __Pyx_RefNannyFinishContext();
7855  return __pyx_r;
7856 }
7857 
7858 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
7859  *
7860  *
7861  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7862  * cdef PyObject* baseptr
7863  * if base is None:
7864  */
7865 
7866 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7867  PyObject *__pyx_v_baseptr;
7868  __Pyx_RefNannyDeclarations
7869  int __pyx_t_1;
7870  int __pyx_t_2;
7871  __Pyx_RefNannySetupContext("set_array_base", 0);
7872 
7873  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
7874  * cdef inline void set_array_base(ndarray arr, object base):
7875  * cdef PyObject* baseptr
7876  * if base is None: # <<<<<<<<<<<<<<
7877  * baseptr = NULL
7878  * else:
7879  */
7880  __pyx_t_1 = (__pyx_v_base == Py_None);
7881  __pyx_t_2 = (__pyx_t_1 != 0);
7882  if (__pyx_t_2) {
7883 
7884  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
7885  * cdef PyObject* baseptr
7886  * if base is None:
7887  * baseptr = NULL # <<<<<<<<<<<<<<
7888  * else:
7889  * Py_INCREF(base) # important to do this before decref below!
7890  */
7891  __pyx_v_baseptr = NULL;
7892 
7893  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
7894  * cdef inline void set_array_base(ndarray arr, object base):
7895  * cdef PyObject* baseptr
7896  * if base is None: # <<<<<<<<<<<<<<
7897  * baseptr = NULL
7898  * else:
7899  */
7900  goto __pyx_L3;
7901  }
7902 
7903  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":982
7904  * baseptr = NULL
7905  * else:
7906  * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
7907  * baseptr = <PyObject*>base
7908  * Py_XDECREF(arr.base)
7909  */
7910  /*else*/ {
7911  Py_INCREF(__pyx_v_base);
7912 
7913  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983
7914  * else:
7915  * Py_INCREF(base) # important to do this before decref below!
7916  * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
7917  * Py_XDECREF(arr.base)
7918  * arr.base = baseptr
7919  */
7920  __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
7921  }
7922  __pyx_L3:;
7923 
7924  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":984
7925  * Py_INCREF(base) # important to do this before decref below!
7926  * baseptr = <PyObject*>base
7927  * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
7928  * arr.base = baseptr
7929  *
7930  */
7931  Py_XDECREF(__pyx_v_arr->base);
7932 
7933  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
7934  * baseptr = <PyObject*>base
7935  * Py_XDECREF(arr.base)
7936  * arr.base = baseptr # <<<<<<<<<<<<<<
7937  *
7938  * cdef inline object get_array_base(ndarray arr):
7939  */
7940  __pyx_v_arr->base = __pyx_v_baseptr;
7941 
7942  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
7943  *
7944  *
7945  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7946  * cdef PyObject* baseptr
7947  * if base is None:
7948  */
7949 
7950  /* function exit code */
7951  __Pyx_RefNannyFinishContext();
7952 }
7953 
7954 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
7955  * arr.base = baseptr
7956  *
7957  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7958  * if arr.base is NULL:
7959  * return None
7960  */
7961 
7962 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7963  PyObject *__pyx_r = NULL;
7964  __Pyx_RefNannyDeclarations
7965  int __pyx_t_1;
7966  __Pyx_RefNannySetupContext("get_array_base", 0);
7967 
7968  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
7969  *
7970  * cdef inline object get_array_base(ndarray arr):
7971  * if arr.base is NULL: # <<<<<<<<<<<<<<
7972  * return None
7973  * else:
7974  */
7975  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
7976  if (__pyx_t_1) {
7977 
7978  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
7979  * cdef inline object get_array_base(ndarray arr):
7980  * if arr.base is NULL:
7981  * return None # <<<<<<<<<<<<<<
7982  * else:
7983  * return <object>arr.base
7984  */
7985  __Pyx_XDECREF(__pyx_r);
7986  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7987  goto __pyx_L0;
7988 
7989  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
7990  *
7991  * cdef inline object get_array_base(ndarray arr):
7992  * if arr.base is NULL: # <<<<<<<<<<<<<<
7993  * return None
7994  * else:
7995  */
7996  }
7997 
7998  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
7999  * return None
8000  * else:
8001  * return <object>arr.base # <<<<<<<<<<<<<<
8002  *
8003  *
8004  */
8005  /*else*/ {
8006  __Pyx_XDECREF(__pyx_r);
8007  __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
8008  __pyx_r = ((PyObject *)__pyx_v_arr->base);
8009  goto __pyx_L0;
8010  }
8011 
8012  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
8013  * arr.base = baseptr
8014  *
8015  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8016  * if arr.base is NULL:
8017  * return None
8018  */
8019 
8020  /* function exit code */
8021  __pyx_L0:;
8022  __Pyx_XGIVEREF(__pyx_r);
8023  __Pyx_RefNannyFinishContext();
8024  return __pyx_r;
8025 }
8026 
8027 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":996
8028  * # Versions of the import_* functions which are more suitable for
8029  * # Cython code.
8030  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8031  * try:
8032  * _import_array()
8033  */
8034 
8035 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
8036  int __pyx_r;
8037  __Pyx_RefNannyDeclarations
8038  PyObject *__pyx_t_1 = NULL;
8039  PyObject *__pyx_t_2 = NULL;
8040  PyObject *__pyx_t_3 = NULL;
8041  int __pyx_t_4;
8042  PyObject *__pyx_t_5 = NULL;
8043  PyObject *__pyx_t_6 = NULL;
8044  PyObject *__pyx_t_7 = NULL;
8045  PyObject *__pyx_t_8 = NULL;
8046  __Pyx_RefNannySetupContext("import_array", 0);
8047 
8048  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
8049  * # Cython code.
8050  * cdef inline int import_array() except -1:
8051  * try: # <<<<<<<<<<<<<<
8052  * _import_array()
8053  * except Exception:
8054  */
8055  {
8056  __Pyx_PyThreadState_declare
8057  __Pyx_PyThreadState_assign
8058  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8059  __Pyx_XGOTREF(__pyx_t_1);
8060  __Pyx_XGOTREF(__pyx_t_2);
8061  __Pyx_XGOTREF(__pyx_t_3);
8062  /*try:*/ {
8063 
8064  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
8065  * cdef inline int import_array() except -1:
8066  * try:
8067  * _import_array() # <<<<<<<<<<<<<<
8068  * except Exception:
8069  * raise ImportError("numpy.core.multiarray failed to import")
8070  */
8071  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 998, __pyx_L3_error)
8072 
8073  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
8074  * # Cython code.
8075  * cdef inline int import_array() except -1:
8076  * try: # <<<<<<<<<<<<<<
8077  * _import_array()
8078  * except Exception:
8079  */
8080  }
8081  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8082  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8083  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8084  goto __pyx_L8_try_end;
8085  __pyx_L3_error:;
8086 
8087  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":999
8088  * try:
8089  * _import_array()
8090  * except Exception: # <<<<<<<<<<<<<<
8091  * raise ImportError("numpy.core.multiarray failed to import")
8092  *
8093  */
8094  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8095  if (__pyx_t_4) {
8096  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8097  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 999, __pyx_L5_except_error)
8098  __Pyx_GOTREF(__pyx_t_5);
8099  __Pyx_GOTREF(__pyx_t_6);
8100  __Pyx_GOTREF(__pyx_t_7);
8101 
8102  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
8103  * _import_array()
8104  * except Exception:
8105  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8106  *
8107  * cdef inline int import_umath() except -1:
8108  */
8109  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1000, __pyx_L5_except_error)
8110  __Pyx_GOTREF(__pyx_t_8);
8111  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8112  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8113  __PYX_ERR(2, 1000, __pyx_L5_except_error)
8114  }
8115  goto __pyx_L5_except_error;
8116  __pyx_L5_except_error:;
8117 
8118  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
8119  * # Cython code.
8120  * cdef inline int import_array() except -1:
8121  * try: # <<<<<<<<<<<<<<
8122  * _import_array()
8123  * except Exception:
8124  */
8125  __Pyx_XGIVEREF(__pyx_t_1);
8126  __Pyx_XGIVEREF(__pyx_t_2);
8127  __Pyx_XGIVEREF(__pyx_t_3);
8128  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8129  goto __pyx_L1_error;
8130  __pyx_L8_try_end:;
8131  }
8132 
8133  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":996
8134  * # Versions of the import_* functions which are more suitable for
8135  * # Cython code.
8136  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8137  * try:
8138  * _import_array()
8139  */
8140 
8141  /* function exit code */
8142  __pyx_r = 0;
8143  goto __pyx_L0;
8144  __pyx_L1_error:;
8145  __Pyx_XDECREF(__pyx_t_5);
8146  __Pyx_XDECREF(__pyx_t_6);
8147  __Pyx_XDECREF(__pyx_t_7);
8148  __Pyx_XDECREF(__pyx_t_8);
8149  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8150  __pyx_r = -1;
8151  __pyx_L0:;
8152  __Pyx_RefNannyFinishContext();
8153  return __pyx_r;
8154 }
8155 
8156 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1002
8157  * raise ImportError("numpy.core.multiarray failed to import")
8158  *
8159  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8160  * try:
8161  * _import_umath()
8162  */
8163 
8164 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
8165  int __pyx_r;
8166  __Pyx_RefNannyDeclarations
8167  PyObject *__pyx_t_1 = NULL;
8168  PyObject *__pyx_t_2 = NULL;
8169  PyObject *__pyx_t_3 = NULL;
8170  int __pyx_t_4;
8171  PyObject *__pyx_t_5 = NULL;
8172  PyObject *__pyx_t_6 = NULL;
8173  PyObject *__pyx_t_7 = NULL;
8174  PyObject *__pyx_t_8 = NULL;
8175  __Pyx_RefNannySetupContext("import_umath", 0);
8176 
8177  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
8178  *
8179  * cdef inline int import_umath() except -1:
8180  * try: # <<<<<<<<<<<<<<
8181  * _import_umath()
8182  * except Exception:
8183  */
8184  {
8185  __Pyx_PyThreadState_declare
8186  __Pyx_PyThreadState_assign
8187  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8188  __Pyx_XGOTREF(__pyx_t_1);
8189  __Pyx_XGOTREF(__pyx_t_2);
8190  __Pyx_XGOTREF(__pyx_t_3);
8191  /*try:*/ {
8192 
8193  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1004
8194  * cdef inline int import_umath() except -1:
8195  * try:
8196  * _import_umath() # <<<<<<<<<<<<<<
8197  * except Exception:
8198  * raise ImportError("numpy.core.umath failed to import")
8199  */
8200  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1004, __pyx_L3_error)
8201 
8202  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
8203  *
8204  * cdef inline int import_umath() except -1:
8205  * try: # <<<<<<<<<<<<<<
8206  * _import_umath()
8207  * except Exception:
8208  */
8209  }
8210  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8211  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8212  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8213  goto __pyx_L8_try_end;
8214  __pyx_L3_error:;
8215 
8216  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1005
8217  * try:
8218  * _import_umath()
8219  * except Exception: # <<<<<<<<<<<<<<
8220  * raise ImportError("numpy.core.umath failed to import")
8221  *
8222  */
8223  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8224  if (__pyx_t_4) {
8225  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8226  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1005, __pyx_L5_except_error)
8227  __Pyx_GOTREF(__pyx_t_5);
8228  __Pyx_GOTREF(__pyx_t_6);
8229  __Pyx_GOTREF(__pyx_t_7);
8230 
8231  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1006
8232  * _import_umath()
8233  * except Exception:
8234  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8235  *
8236  * cdef inline int import_ufunc() except -1:
8237  */
8238  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1006, __pyx_L5_except_error)
8239  __Pyx_GOTREF(__pyx_t_8);
8240  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8241  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8242  __PYX_ERR(2, 1006, __pyx_L5_except_error)
8243  }
8244  goto __pyx_L5_except_error;
8245  __pyx_L5_except_error:;
8246 
8247  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
8248  *
8249  * cdef inline int import_umath() except -1:
8250  * try: # <<<<<<<<<<<<<<
8251  * _import_umath()
8252  * except Exception:
8253  */
8254  __Pyx_XGIVEREF(__pyx_t_1);
8255  __Pyx_XGIVEREF(__pyx_t_2);
8256  __Pyx_XGIVEREF(__pyx_t_3);
8257  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8258  goto __pyx_L1_error;
8259  __pyx_L8_try_end:;
8260  }
8261 
8262  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1002
8263  * raise ImportError("numpy.core.multiarray failed to import")
8264  *
8265  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8266  * try:
8267  * _import_umath()
8268  */
8269 
8270  /* function exit code */
8271  __pyx_r = 0;
8272  goto __pyx_L0;
8273  __pyx_L1_error:;
8274  __Pyx_XDECREF(__pyx_t_5);
8275  __Pyx_XDECREF(__pyx_t_6);
8276  __Pyx_XDECREF(__pyx_t_7);
8277  __Pyx_XDECREF(__pyx_t_8);
8278  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8279  __pyx_r = -1;
8280  __pyx_L0:;
8281  __Pyx_RefNannyFinishContext();
8282  return __pyx_r;
8283 }
8284 
8285 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1008
8286  * raise ImportError("numpy.core.umath failed to import")
8287  *
8288  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8289  * try:
8290  * _import_umath()
8291  */
8292 
8293 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8294  int __pyx_r;
8295  __Pyx_RefNannyDeclarations
8296  PyObject *__pyx_t_1 = NULL;
8297  PyObject *__pyx_t_2 = NULL;
8298  PyObject *__pyx_t_3 = NULL;
8299  int __pyx_t_4;
8300  PyObject *__pyx_t_5 = NULL;
8301  PyObject *__pyx_t_6 = NULL;
8302  PyObject *__pyx_t_7 = NULL;
8303  PyObject *__pyx_t_8 = NULL;
8304  __Pyx_RefNannySetupContext("import_ufunc", 0);
8305 
8306  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
8307  *
8308  * cdef inline int import_ufunc() except -1:
8309  * try: # <<<<<<<<<<<<<<
8310  * _import_umath()
8311  * except Exception:
8312  */
8313  {
8314  __Pyx_PyThreadState_declare
8315  __Pyx_PyThreadState_assign
8316  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8317  __Pyx_XGOTREF(__pyx_t_1);
8318  __Pyx_XGOTREF(__pyx_t_2);
8319  __Pyx_XGOTREF(__pyx_t_3);
8320  /*try:*/ {
8321 
8322  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1010
8323  * cdef inline int import_ufunc() except -1:
8324  * try:
8325  * _import_umath() # <<<<<<<<<<<<<<
8326  * except Exception:
8327  * raise ImportError("numpy.core.umath failed to import")
8328  */
8329  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1010, __pyx_L3_error)
8330 
8331  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
8332  *
8333  * cdef inline int import_ufunc() except -1:
8334  * try: # <<<<<<<<<<<<<<
8335  * _import_umath()
8336  * except Exception:
8337  */
8338  }
8339  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8340  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8341  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8342  goto __pyx_L8_try_end;
8343  __pyx_L3_error:;
8344 
8345  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1011
8346  * try:
8347  * _import_umath()
8348  * except Exception: # <<<<<<<<<<<<<<
8349  * raise ImportError("numpy.core.umath failed to import")
8350  */
8351  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8352  if (__pyx_t_4) {
8353  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8354  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1011, __pyx_L5_except_error)
8355  __Pyx_GOTREF(__pyx_t_5);
8356  __Pyx_GOTREF(__pyx_t_6);
8357  __Pyx_GOTREF(__pyx_t_7);
8358 
8359  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1012
8360  * _import_umath()
8361  * except Exception:
8362  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8363  */
8364  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1012, __pyx_L5_except_error)
8365  __Pyx_GOTREF(__pyx_t_8);
8366  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8367  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8368  __PYX_ERR(2, 1012, __pyx_L5_except_error)
8369  }
8370  goto __pyx_L5_except_error;
8371  __pyx_L5_except_error:;
8372 
8373  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
8374  *
8375  * cdef inline int import_ufunc() except -1:
8376  * try: # <<<<<<<<<<<<<<
8377  * _import_umath()
8378  * except Exception:
8379  */
8380  __Pyx_XGIVEREF(__pyx_t_1);
8381  __Pyx_XGIVEREF(__pyx_t_2);
8382  __Pyx_XGIVEREF(__pyx_t_3);
8383  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8384  goto __pyx_L1_error;
8385  __pyx_L8_try_end:;
8386  }
8387 
8388  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1008
8389  * raise ImportError("numpy.core.umath failed to import")
8390  *
8391  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8392  * try:
8393  * _import_umath()
8394  */
8395 
8396  /* function exit code */
8397  __pyx_r = 0;
8398  goto __pyx_L0;
8399  __pyx_L1_error:;
8400  __Pyx_XDECREF(__pyx_t_5);
8401  __Pyx_XDECREF(__pyx_t_6);
8402  __Pyx_XDECREF(__pyx_t_7);
8403  __Pyx_XDECREF(__pyx_t_8);
8404  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8405  __pyx_r = -1;
8406  __pyx_L0:;
8407  __Pyx_RefNannyFinishContext();
8408  return __pyx_r;
8409 }
8410 
8411 /* "View.MemoryView":121
8412  * cdef bint dtype_is_object
8413  *
8414  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8415  * mode="c", bint allocate_buffer=True):
8416  *
8417  */
8418 
8419 /* Python wrapper */
8420 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8421 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8422  PyObject *__pyx_v_shape = 0;
8423  Py_ssize_t __pyx_v_itemsize;
8424  PyObject *__pyx_v_format = 0;
8425  PyObject *__pyx_v_mode = 0;
8426  int __pyx_v_allocate_buffer;
8427  int __pyx_r;
8428  __Pyx_RefNannyDeclarations
8429  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8430  {
8431  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8432  PyObject* values[5] = {0,0,0,0,0};
8433  values[3] = ((PyObject *)__pyx_n_s_c);
8434  if (unlikely(__pyx_kwds)) {
8435  Py_ssize_t kw_args;
8436  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8437  switch (pos_args) {
8438  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8439  CYTHON_FALLTHROUGH;
8440  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8441  CYTHON_FALLTHROUGH;
8442  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8443  CYTHON_FALLTHROUGH;
8444  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8445  CYTHON_FALLTHROUGH;
8446  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8447  CYTHON_FALLTHROUGH;
8448  case 0: break;
8449  default: goto __pyx_L5_argtuple_error;
8450  }
8451  kw_args = PyDict_Size(__pyx_kwds);
8452  switch (pos_args) {
8453  case 0:
8454  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8455  else goto __pyx_L5_argtuple_error;
8456  CYTHON_FALLTHROUGH;
8457  case 1:
8458  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8459  else {
8460  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 121, __pyx_L3_error)
8461  }
8462  CYTHON_FALLTHROUGH;
8463  case 2:
8464  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8465  else {
8466  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 121, __pyx_L3_error)
8467  }
8468  CYTHON_FALLTHROUGH;
8469  case 3:
8470  if (kw_args > 0) {
8471  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8472  if (value) { values[3] = value; kw_args--; }
8473  }
8474  CYTHON_FALLTHROUGH;
8475  case 4:
8476  if (kw_args > 0) {
8477  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8478  if (value) { values[4] = value; kw_args--; }
8479  }
8480  }
8481  if (unlikely(kw_args > 0)) {
8482  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 121, __pyx_L3_error)
8483  }
8484  } else {
8485  switch (PyTuple_GET_SIZE(__pyx_args)) {
8486  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8487  CYTHON_FALLTHROUGH;
8488  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8489  CYTHON_FALLTHROUGH;
8490  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8491  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8492  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8493  break;
8494  default: goto __pyx_L5_argtuple_error;
8495  }
8496  }
8497  __pyx_v_shape = ((PyObject*)values[0]);
8498  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
8499  __pyx_v_format = values[2];
8500  __pyx_v_mode = values[3];
8501  if (values[4]) {
8502  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8503  } else {
8504 
8505  /* "View.MemoryView":122
8506  *
8507  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8508  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8509  *
8510  * cdef int idx
8511  */
8512  __pyx_v_allocate_buffer = ((int)1);
8513  }
8514  }
8515  goto __pyx_L4_argument_unpacking_done;
8516  __pyx_L5_argtuple_error:;
8517  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 121, __pyx_L3_error)
8518  __pyx_L3_error:;
8519  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8520  __Pyx_RefNannyFinishContext();
8521  return -1;
8522  __pyx_L4_argument_unpacking_done:;
8523  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 121, __pyx_L1_error)
8524  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8525  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 121, __pyx_L1_error)
8526  }
8527  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8528 
8529  /* "View.MemoryView":121
8530  * cdef bint dtype_is_object
8531  *
8532  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8533  * mode="c", bint allocate_buffer=True):
8534  *
8535  */
8536 
8537  /* function exit code */
8538  goto __pyx_L0;
8539  __pyx_L1_error:;
8540  __pyx_r = -1;
8541  __pyx_L0:;
8542  __Pyx_RefNannyFinishContext();
8543  return __pyx_r;
8544 }
8545 
8546 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
8547  int __pyx_v_idx;
8548  Py_ssize_t __pyx_v_i;
8549  Py_ssize_t __pyx_v_dim;
8550  PyObject **__pyx_v_p;
8551  char __pyx_v_order;
8552  int __pyx_r;
8553  __Pyx_RefNannyDeclarations
8554  Py_ssize_t __pyx_t_1;
8555  int __pyx_t_2;
8556  PyObject *__pyx_t_3 = NULL;
8557  int __pyx_t_4;
8558  PyObject *__pyx_t_5 = NULL;
8559  char *__pyx_t_6;
8560  int __pyx_t_7;
8561  Py_ssize_t __pyx_t_8;
8562  PyObject *__pyx_t_9 = NULL;
8563  PyObject *__pyx_t_10 = NULL;
8564  Py_ssize_t __pyx_t_11;
8565  __Pyx_RefNannySetupContext("__cinit__", 0);
8566  __Pyx_INCREF(__pyx_v_format);
8567 
8568  /* "View.MemoryView":128
8569  * cdef PyObject **p
8570  *
8571  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8572  * self.itemsize = itemsize
8573  *
8574  */
8575  if (unlikely(__pyx_v_shape == Py_None)) {
8576  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8577  __PYX_ERR(1, 128, __pyx_L1_error)
8578  }
8579  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 128, __pyx_L1_error)
8580  __pyx_v_self->ndim = ((int)__pyx_t_1);
8581 
8582  /* "View.MemoryView":129
8583  *
8584  * self.ndim = <int> len(shape)
8585  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8586  *
8587  * if not self.ndim:
8588  */
8589  __pyx_v_self->itemsize = __pyx_v_itemsize;
8590 
8591  /* "View.MemoryView":131
8592  * self.itemsize = itemsize
8593  *
8594  * if not self.ndim: # <<<<<<<<<<<<<<
8595  * raise ValueError("Empty shape tuple for cython.array")
8596  *
8597  */
8598  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8599  if (unlikely(__pyx_t_2)) {
8600 
8601  /* "View.MemoryView":132
8602  *
8603  * if not self.ndim:
8604  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8605  *
8606  * if itemsize <= 0:
8607  */
8608  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error)
8609  __Pyx_GOTREF(__pyx_t_3);
8610  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8611  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8612  __PYX_ERR(1, 132, __pyx_L1_error)
8613 
8614  /* "View.MemoryView":131
8615  * self.itemsize = itemsize
8616  *
8617  * if not self.ndim: # <<<<<<<<<<<<<<
8618  * raise ValueError("Empty shape tuple for cython.array")
8619  *
8620  */
8621  }
8622 
8623  /* "View.MemoryView":134
8624  * raise ValueError("Empty shape tuple for cython.array")
8625  *
8626  * if itemsize <= 0: # <<<<<<<<<<<<<<
8627  * raise ValueError("itemsize <= 0 for cython.array")
8628  *
8629  */
8630  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8631  if (unlikely(__pyx_t_2)) {
8632 
8633  /* "View.MemoryView":135
8634  *
8635  * if itemsize <= 0:
8636  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8637  *
8638  * if not isinstance(format, bytes):
8639  */
8640  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 135, __pyx_L1_error)
8641  __Pyx_GOTREF(__pyx_t_3);
8642  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8643  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8644  __PYX_ERR(1, 135, __pyx_L1_error)
8645 
8646  /* "View.MemoryView":134
8647  * raise ValueError("Empty shape tuple for cython.array")
8648  *
8649  * if itemsize <= 0: # <<<<<<<<<<<<<<
8650  * raise ValueError("itemsize <= 0 for cython.array")
8651  *
8652  */
8653  }
8654 
8655  /* "View.MemoryView":137
8656  * raise ValueError("itemsize <= 0 for cython.array")
8657  *
8658  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8659  * format = format.encode('ASCII')
8660  * self._format = format # keep a reference to the byte string
8661  */
8662  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8663  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8664  if (__pyx_t_4) {
8665 
8666  /* "View.MemoryView":138
8667  *
8668  * if not isinstance(format, bytes):
8669  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8670  * self._format = format # keep a reference to the byte string
8671  * self.format = self._format
8672  */
8673  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 138, __pyx_L1_error)
8674  __Pyx_GOTREF(__pyx_t_3);
8675  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 138, __pyx_L1_error)
8676  __Pyx_GOTREF(__pyx_t_5);
8677  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8678  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
8679  __pyx_t_5 = 0;
8680 
8681  /* "View.MemoryView":137
8682  * raise ValueError("itemsize <= 0 for cython.array")
8683  *
8684  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8685  * format = format.encode('ASCII')
8686  * self._format = format # keep a reference to the byte string
8687  */
8688  }
8689 
8690  /* "View.MemoryView":139
8691  * if not isinstance(format, bytes):
8692  * format = format.encode('ASCII')
8693  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8694  * self.format = self._format
8695  *
8696  */
8697  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 139, __pyx_L1_error)
8698  __pyx_t_5 = __pyx_v_format;
8699  __Pyx_INCREF(__pyx_t_5);
8700  __Pyx_GIVEREF(__pyx_t_5);
8701  __Pyx_GOTREF(__pyx_v_self->_format);
8702  __Pyx_DECREF(__pyx_v_self->_format);
8703  __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
8704  __pyx_t_5 = 0;
8705 
8706  /* "View.MemoryView":140
8707  * format = format.encode('ASCII')
8708  * self._format = format # keep a reference to the byte string
8709  * self.format = self._format # <<<<<<<<<<<<<<
8710  *
8711  *
8712  */
8713  if (unlikely(__pyx_v_self->_format == Py_None)) {
8714  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8715  __PYX_ERR(1, 140, __pyx_L1_error)
8716  }
8717  __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L1_error)
8718  __pyx_v_self->format = __pyx_t_6;
8719 
8720  /* "View.MemoryView":143
8721  *
8722  *
8723  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8724  * self._strides = self._shape + self.ndim
8725  *
8726  */
8727  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8728 
8729  /* "View.MemoryView":144
8730  *
8731  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8732  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8733  *
8734  * if not self._shape:
8735  */
8736  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8737 
8738  /* "View.MemoryView":146
8739  * self._strides = self._shape + self.ndim
8740  *
8741  * if not self._shape: # <<<<<<<<<<<<<<
8742  * raise MemoryError("unable to allocate shape and strides.")
8743  *
8744  */
8745  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8746  if (unlikely(__pyx_t_4)) {
8747 
8748  /* "View.MemoryView":147
8749  *
8750  * if not self._shape:
8751  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8752  *
8753  *
8754  */
8755  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
8756  __Pyx_GOTREF(__pyx_t_5);
8757  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
8758  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8759  __PYX_ERR(1, 147, __pyx_L1_error)
8760 
8761  /* "View.MemoryView":146
8762  * self._strides = self._shape + self.ndim
8763  *
8764  * if not self._shape: # <<<<<<<<<<<<<<
8765  * raise MemoryError("unable to allocate shape and strides.")
8766  *
8767  */
8768  }
8769 
8770  /* "View.MemoryView":150
8771  *
8772  *
8773  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8774  * if dim <= 0:
8775  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8776  */
8777  __pyx_t_7 = 0;
8778  __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
8779  for (;;) {
8780  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
8781  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8782  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 150, __pyx_L1_error)
8783  #else
8784  __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error)
8785  __Pyx_GOTREF(__pyx_t_3);
8786  #endif
8787  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error)
8788  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8789  __pyx_v_dim = __pyx_t_8;
8790  __pyx_v_idx = __pyx_t_7;
8791  __pyx_t_7 = (__pyx_t_7 + 1);
8792 
8793  /* "View.MemoryView":151
8794  *
8795  * for idx, dim in enumerate(shape):
8796  * if dim <= 0: # <<<<<<<<<<<<<<
8797  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8798  * self._shape[idx] = dim
8799  */
8800  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8801  if (unlikely(__pyx_t_4)) {
8802 
8803  /* "View.MemoryView":152
8804  * for idx, dim in enumerate(shape):
8805  * if dim <= 0:
8806  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8807  * self._shape[idx] = dim
8808  *
8809  */
8810  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
8811  __Pyx_GOTREF(__pyx_t_3);
8812  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
8813  __Pyx_GOTREF(__pyx_t_9);
8814  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
8815  __Pyx_GOTREF(__pyx_t_10);
8816  __Pyx_GIVEREF(__pyx_t_3);
8817  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
8818  __Pyx_GIVEREF(__pyx_t_9);
8819  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
8820  __pyx_t_3 = 0;
8821  __pyx_t_9 = 0;
8822  __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
8823  __Pyx_GOTREF(__pyx_t_9);
8824  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8825  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
8826  __Pyx_GOTREF(__pyx_t_10);
8827  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8828  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8829  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8830  __PYX_ERR(1, 152, __pyx_L1_error)
8831 
8832  /* "View.MemoryView":151
8833  *
8834  * for idx, dim in enumerate(shape):
8835  * if dim <= 0: # <<<<<<<<<<<<<<
8836  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8837  * self._shape[idx] = dim
8838  */
8839  }
8840 
8841  /* "View.MemoryView":153
8842  * if dim <= 0:
8843  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8844  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8845  *
8846  * cdef char order
8847  */
8848  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8849 
8850  /* "View.MemoryView":150
8851  *
8852  *
8853  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8854  * if dim <= 0:
8855  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8856  */
8857  }
8858  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8859 
8860  /* "View.MemoryView":156
8861  *
8862  * cdef char order
8863  * if mode == 'fortran': # <<<<<<<<<<<<<<
8864  * order = b'F'
8865  * self.mode = u'fortran'
8866  */
8867  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 156, __pyx_L1_error)
8868  if (__pyx_t_4) {
8869 
8870  /* "View.MemoryView":157
8871  * cdef char order
8872  * if mode == 'fortran':
8873  * order = b'F' # <<<<<<<<<<<<<<
8874  * self.mode = u'fortran'
8875  * elif mode == 'c':
8876  */
8877  __pyx_v_order = 'F';
8878 
8879  /* "View.MemoryView":158
8880  * if mode == 'fortran':
8881  * order = b'F'
8882  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8883  * elif mode == 'c':
8884  * order = b'C'
8885  */
8886  __Pyx_INCREF(__pyx_n_u_fortran);
8887  __Pyx_GIVEREF(__pyx_n_u_fortran);
8888  __Pyx_GOTREF(__pyx_v_self->mode);
8889  __Pyx_DECREF(__pyx_v_self->mode);
8890  __pyx_v_self->mode = __pyx_n_u_fortran;
8891 
8892  /* "View.MemoryView":156
8893  *
8894  * cdef char order
8895  * if mode == 'fortran': # <<<<<<<<<<<<<<
8896  * order = b'F'
8897  * self.mode = u'fortran'
8898  */
8899  goto __pyx_L10;
8900  }
8901 
8902  /* "View.MemoryView":159
8903  * order = b'F'
8904  * self.mode = u'fortran'
8905  * elif mode == 'c': # <<<<<<<<<<<<<<
8906  * order = b'C'
8907  * self.mode = u'c'
8908  */
8909  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 159, __pyx_L1_error)
8910  if (likely(__pyx_t_4)) {
8911 
8912  /* "View.MemoryView":160
8913  * self.mode = u'fortran'
8914  * elif mode == 'c':
8915  * order = b'C' # <<<<<<<<<<<<<<
8916  * self.mode = u'c'
8917  * else:
8918  */
8919  __pyx_v_order = 'C';
8920 
8921  /* "View.MemoryView":161
8922  * elif mode == 'c':
8923  * order = b'C'
8924  * self.mode = u'c' # <<<<<<<<<<<<<<
8925  * else:
8926  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8927  */
8928  __Pyx_INCREF(__pyx_n_u_c);
8929  __Pyx_GIVEREF(__pyx_n_u_c);
8930  __Pyx_GOTREF(__pyx_v_self->mode);
8931  __Pyx_DECREF(__pyx_v_self->mode);
8932  __pyx_v_self->mode = __pyx_n_u_c;
8933 
8934  /* "View.MemoryView":159
8935  * order = b'F'
8936  * self.mode = u'fortran'
8937  * elif mode == 'c': # <<<<<<<<<<<<<<
8938  * order = b'C'
8939  * self.mode = u'c'
8940  */
8941  goto __pyx_L10;
8942  }
8943 
8944  /* "View.MemoryView":163
8945  * self.mode = u'c'
8946  * else:
8947  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8948  *
8949  * self.len = fill_contig_strides_array(self._shape, self._strides,
8950  */
8951  /*else*/ {
8952  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
8953  __Pyx_GOTREF(__pyx_t_5);
8954  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 163, __pyx_L1_error)
8955  __Pyx_GOTREF(__pyx_t_10);
8956  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8957  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8958  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8959  __PYX_ERR(1, 163, __pyx_L1_error)
8960  }
8961  __pyx_L10:;
8962 
8963  /* "View.MemoryView":165
8964  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8965  *
8966  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8967  * itemsize, self.ndim, order)
8968  *
8969  */
8970  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8971 
8972  /* "View.MemoryView":168
8973  * itemsize, self.ndim, order)
8974  *
8975  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8976  * self.dtype_is_object = format == b'O'
8977  * if allocate_buffer:
8978  */
8979  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8980 
8981  /* "View.MemoryView":169
8982  *
8983  * self.free_data = allocate_buffer
8984  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8985  * if allocate_buffer:
8986  *
8987  */
8988  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 169, __pyx_L1_error)
8989  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 169, __pyx_L1_error)
8990  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8991  __pyx_v_self->dtype_is_object = __pyx_t_4;
8992 
8993  /* "View.MemoryView":170
8994  * self.free_data = allocate_buffer
8995  * self.dtype_is_object = format == b'O'
8996  * if allocate_buffer: # <<<<<<<<<<<<<<
8997  *
8998  *
8999  */
9000  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9001  if (__pyx_t_4) {
9002 
9003  /* "View.MemoryView":173
9004  *
9005  *
9006  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
9007  * if not self.data:
9008  * raise MemoryError("unable to allocate array data.")
9009  */
9010  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
9011 
9012  /* "View.MemoryView":174
9013  *
9014  * self.data = <char *>malloc(self.len)
9015  * if not self.data: # <<<<<<<<<<<<<<
9016  * raise MemoryError("unable to allocate array data.")
9017  *
9018  */
9019  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9020  if (unlikely(__pyx_t_4)) {
9021 
9022  /* "View.MemoryView":175
9023  * self.data = <char *>malloc(self.len)
9024  * if not self.data:
9025  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
9026  *
9027  * if self.dtype_is_object:
9028  */
9029  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 175, __pyx_L1_error)
9030  __Pyx_GOTREF(__pyx_t_10);
9031  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9032  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9033  __PYX_ERR(1, 175, __pyx_L1_error)
9034 
9035  /* "View.MemoryView":174
9036  *
9037  * self.data = <char *>malloc(self.len)
9038  * if not self.data: # <<<<<<<<<<<<<<
9039  * raise MemoryError("unable to allocate array data.")
9040  *
9041  */
9042  }
9043 
9044  /* "View.MemoryView":177
9045  * raise MemoryError("unable to allocate array data.")
9046  *
9047  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9048  * p = <PyObject **> self.data
9049  * for i in range(self.len / itemsize):
9050  */
9051  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9052  if (__pyx_t_4) {
9053 
9054  /* "View.MemoryView":178
9055  *
9056  * if self.dtype_is_object:
9057  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
9058  * for i in range(self.len / itemsize):
9059  * p[i] = Py_None
9060  */
9061  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9062 
9063  /* "View.MemoryView":179
9064  * if self.dtype_is_object:
9065  * p = <PyObject **> self.data
9066  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
9067  * p[i] = Py_None
9068  * Py_INCREF(Py_None)
9069  */
9070  if (unlikely(__pyx_v_itemsize == 0)) {
9071  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9072  __PYX_ERR(1, 179, __pyx_L1_error)
9073  }
9074  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9075  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
9076  __PYX_ERR(1, 179, __pyx_L1_error)
9077  }
9078  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9079  __pyx_t_8 = __pyx_t_1;
9080  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
9081  __pyx_v_i = __pyx_t_11;
9082 
9083  /* "View.MemoryView":180
9084  * p = <PyObject **> self.data
9085  * for i in range(self.len / itemsize):
9086  * p[i] = Py_None # <<<<<<<<<<<<<<
9087  * Py_INCREF(Py_None)
9088  *
9089  */
9090  (__pyx_v_p[__pyx_v_i]) = Py_None;
9091 
9092  /* "View.MemoryView":181
9093  * for i in range(self.len / itemsize):
9094  * p[i] = Py_None
9095  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9096  *
9097  * @cname('getbuffer')
9098  */
9099  Py_INCREF(Py_None);
9100  }
9101 
9102  /* "View.MemoryView":177
9103  * raise MemoryError("unable to allocate array data.")
9104  *
9105  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9106  * p = <PyObject **> self.data
9107  * for i in range(self.len / itemsize):
9108  */
9109  }
9110 
9111  /* "View.MemoryView":170
9112  * self.free_data = allocate_buffer
9113  * self.dtype_is_object = format == b'O'
9114  * if allocate_buffer: # <<<<<<<<<<<<<<
9115  *
9116  *
9117  */
9118  }
9119 
9120  /* "View.MemoryView":121
9121  * cdef bint dtype_is_object
9122  *
9123  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9124  * mode="c", bint allocate_buffer=True):
9125  *
9126  */
9127 
9128  /* function exit code */
9129  __pyx_r = 0;
9130  goto __pyx_L0;
9131  __pyx_L1_error:;
9132  __Pyx_XDECREF(__pyx_t_3);
9133  __Pyx_XDECREF(__pyx_t_5);
9134  __Pyx_XDECREF(__pyx_t_9);
9135  __Pyx_XDECREF(__pyx_t_10);
9136  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9137  __pyx_r = -1;
9138  __pyx_L0:;
9139  __Pyx_XDECREF(__pyx_v_format);
9140  __Pyx_RefNannyFinishContext();
9141  return __pyx_r;
9142 }
9143 
9144 /* "View.MemoryView":184
9145  *
9146  * @cname('getbuffer')
9147  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9148  * cdef int bufmode = -1
9149  * if self.mode == u"c":
9150  */
9151 
9152 /* Python wrapper */
9153 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9154 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9155  int __pyx_r;
9156  __Pyx_RefNannyDeclarations
9157  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9158  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9159 
9160  /* function exit code */
9161  __Pyx_RefNannyFinishContext();
9162  return __pyx_r;
9163 }
9164 
9165 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9166  int __pyx_v_bufmode;
9167  int __pyx_r;
9168  __Pyx_RefNannyDeclarations
9169  int __pyx_t_1;
9170  int __pyx_t_2;
9171  PyObject *__pyx_t_3 = NULL;
9172  char *__pyx_t_4;
9173  Py_ssize_t __pyx_t_5;
9174  int __pyx_t_6;
9175  Py_ssize_t *__pyx_t_7;
9176  if (__pyx_v_info == NULL) {
9177  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9178  return -1;
9179  }
9180  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9181  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9182  __Pyx_GIVEREF(__pyx_v_info->obj);
9183 
9184  /* "View.MemoryView":185
9185  * @cname('getbuffer')
9186  * def __getbuffer__(self, Py_buffer *info, int flags):
9187  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
9188  * if self.mode == u"c":
9189  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9190  */
9191  __pyx_v_bufmode = -1;
9192 
9193  /* "View.MemoryView":186
9194  * def __getbuffer__(self, Py_buffer *info, int flags):
9195  * cdef int bufmode = -1
9196  * if self.mode == u"c": # <<<<<<<<<<<<<<
9197  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9198  * elif self.mode == u"fortran":
9199  */
9200  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 186, __pyx_L1_error)
9201  __pyx_t_2 = (__pyx_t_1 != 0);
9202  if (__pyx_t_2) {
9203 
9204  /* "View.MemoryView":187
9205  * cdef int bufmode = -1
9206  * if self.mode == u"c":
9207  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9208  * elif self.mode == u"fortran":
9209  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9210  */
9211  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9212 
9213  /* "View.MemoryView":186
9214  * def __getbuffer__(self, Py_buffer *info, int flags):
9215  * cdef int bufmode = -1
9216  * if self.mode == u"c": # <<<<<<<<<<<<<<
9217  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9218  * elif self.mode == u"fortran":
9219  */
9220  goto __pyx_L3;
9221  }
9222 
9223  /* "View.MemoryView":188
9224  * if self.mode == u"c":
9225  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9226  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9227  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9228  * if not (flags & bufmode):
9229  */
9230  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
9231  __pyx_t_1 = (__pyx_t_2 != 0);
9232  if (__pyx_t_1) {
9233 
9234  /* "View.MemoryView":189
9235  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9236  * elif self.mode == u"fortran":
9237  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9238  * if not (flags & bufmode):
9239  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9240  */
9241  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9242 
9243  /* "View.MemoryView":188
9244  * if self.mode == u"c":
9245  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9246  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9247  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9248  * if not (flags & bufmode):
9249  */
9250  }
9251  __pyx_L3:;
9252 
9253  /* "View.MemoryView":190
9254  * elif self.mode == u"fortran":
9255  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9256  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9257  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9258  * info.buf = self.data
9259  */
9260  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9261  if (unlikely(__pyx_t_1)) {
9262 
9263  /* "View.MemoryView":191
9264  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9265  * if not (flags & bufmode):
9266  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9267  * info.buf = self.data
9268  * info.len = self.len
9269  */
9270  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 191, __pyx_L1_error)
9271  __Pyx_GOTREF(__pyx_t_3);
9272  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9273  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9274  __PYX_ERR(1, 191, __pyx_L1_error)
9275 
9276  /* "View.MemoryView":190
9277  * elif self.mode == u"fortran":
9278  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9279  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9280  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9281  * info.buf = self.data
9282  */
9283  }
9284 
9285  /* "View.MemoryView":192
9286  * if not (flags & bufmode):
9287  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9288  * info.buf = self.data # <<<<<<<<<<<<<<
9289  * info.len = self.len
9290  * info.ndim = self.ndim
9291  */
9292  __pyx_t_4 = __pyx_v_self->data;
9293  __pyx_v_info->buf = __pyx_t_4;
9294 
9295  /* "View.MemoryView":193
9296  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9297  * info.buf = self.data
9298  * info.len = self.len # <<<<<<<<<<<<<<
9299  * info.ndim = self.ndim
9300  * info.shape = self._shape
9301  */
9302  __pyx_t_5 = __pyx_v_self->len;
9303  __pyx_v_info->len = __pyx_t_5;
9304 
9305  /* "View.MemoryView":194
9306  * info.buf = self.data
9307  * info.len = self.len
9308  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9309  * info.shape = self._shape
9310  * info.strides = self._strides
9311  */
9312  __pyx_t_6 = __pyx_v_self->ndim;
9313  __pyx_v_info->ndim = __pyx_t_6;
9314 
9315  /* "View.MemoryView":195
9316  * info.len = self.len
9317  * info.ndim = self.ndim
9318  * info.shape = self._shape # <<<<<<<<<<<<<<
9319  * info.strides = self._strides
9320  * info.suboffsets = NULL
9321  */
9322  __pyx_t_7 = __pyx_v_self->_shape;
9323  __pyx_v_info->shape = __pyx_t_7;
9324 
9325  /* "View.MemoryView":196
9326  * info.ndim = self.ndim
9327  * info.shape = self._shape
9328  * info.strides = self._strides # <<<<<<<<<<<<<<
9329  * info.suboffsets = NULL
9330  * info.itemsize = self.itemsize
9331  */
9332  __pyx_t_7 = __pyx_v_self->_strides;
9333  __pyx_v_info->strides = __pyx_t_7;
9334 
9335  /* "View.MemoryView":197
9336  * info.shape = self._shape
9337  * info.strides = self._strides
9338  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9339  * info.itemsize = self.itemsize
9340  * info.readonly = 0
9341  */
9342  __pyx_v_info->suboffsets = NULL;
9343 
9344  /* "View.MemoryView":198
9345  * info.strides = self._strides
9346  * info.suboffsets = NULL
9347  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9348  * info.readonly = 0
9349  *
9350  */
9351  __pyx_t_5 = __pyx_v_self->itemsize;
9352  __pyx_v_info->itemsize = __pyx_t_5;
9353 
9354  /* "View.MemoryView":199
9355  * info.suboffsets = NULL
9356  * info.itemsize = self.itemsize
9357  * info.readonly = 0 # <<<<<<<<<<<<<<
9358  *
9359  * if flags & PyBUF_FORMAT:
9360  */
9361  __pyx_v_info->readonly = 0;
9362 
9363  /* "View.MemoryView":201
9364  * info.readonly = 0
9365  *
9366  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9367  * info.format = self.format
9368  * else:
9369  */
9370  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9371  if (__pyx_t_1) {
9372 
9373  /* "View.MemoryView":202
9374  *
9375  * if flags & PyBUF_FORMAT:
9376  * info.format = self.format # <<<<<<<<<<<<<<
9377  * else:
9378  * info.format = NULL
9379  */
9380  __pyx_t_4 = __pyx_v_self->format;
9381  __pyx_v_info->format = __pyx_t_4;
9382 
9383  /* "View.MemoryView":201
9384  * info.readonly = 0
9385  *
9386  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9387  * info.format = self.format
9388  * else:
9389  */
9390  goto __pyx_L5;
9391  }
9392 
9393  /* "View.MemoryView":204
9394  * info.format = self.format
9395  * else:
9396  * info.format = NULL # <<<<<<<<<<<<<<
9397  *
9398  * info.obj = self
9399  */
9400  /*else*/ {
9401  __pyx_v_info->format = NULL;
9402  }
9403  __pyx_L5:;
9404 
9405  /* "View.MemoryView":206
9406  * info.format = NULL
9407  *
9408  * info.obj = self # <<<<<<<<<<<<<<
9409  *
9410  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9411  */
9412  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9413  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9414  __Pyx_GOTREF(__pyx_v_info->obj);
9415  __Pyx_DECREF(__pyx_v_info->obj);
9416  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9417 
9418  /* "View.MemoryView":184
9419  *
9420  * @cname('getbuffer')
9421  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9422  * cdef int bufmode = -1
9423  * if self.mode == u"c":
9424  */
9425 
9426  /* function exit code */
9427  __pyx_r = 0;
9428  goto __pyx_L0;
9429  __pyx_L1_error:;
9430  __Pyx_XDECREF(__pyx_t_3);
9431  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9432  __pyx_r = -1;
9433  if (__pyx_v_info->obj != NULL) {
9434  __Pyx_GOTREF(__pyx_v_info->obj);
9435  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9436  }
9437  goto __pyx_L2;
9438  __pyx_L0:;
9439  if (__pyx_v_info->obj == Py_None) {
9440  __Pyx_GOTREF(__pyx_v_info->obj);
9441  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9442  }
9443  __pyx_L2:;
9444  __Pyx_RefNannyFinishContext();
9445  return __pyx_r;
9446 }
9447 
9448 /* "View.MemoryView":210
9449  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9450  *
9451  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9452  * if self.callback_free_data != NULL:
9453  * self.callback_free_data(self.data)
9454  */
9455 
9456 /* Python wrapper */
9457 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9458 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9459  __Pyx_RefNannyDeclarations
9460  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9461  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9462 
9463  /* function exit code */
9464  __Pyx_RefNannyFinishContext();
9465 }
9466 
9467 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9468  __Pyx_RefNannyDeclarations
9469  int __pyx_t_1;
9470  __Pyx_RefNannySetupContext("__dealloc__", 0);
9471 
9472  /* "View.MemoryView":211
9473  *
9474  * def __dealloc__(array self):
9475  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9476  * self.callback_free_data(self.data)
9477  * elif self.free_data:
9478  */
9479  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9480  if (__pyx_t_1) {
9481 
9482  /* "View.MemoryView":212
9483  * def __dealloc__(array self):
9484  * if self.callback_free_data != NULL:
9485  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9486  * elif self.free_data:
9487  * if self.dtype_is_object:
9488  */
9489  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9490 
9491  /* "View.MemoryView":211
9492  *
9493  * def __dealloc__(array self):
9494  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9495  * self.callback_free_data(self.data)
9496  * elif self.free_data:
9497  */
9498  goto __pyx_L3;
9499  }
9500 
9501  /* "View.MemoryView":213
9502  * if self.callback_free_data != NULL:
9503  * self.callback_free_data(self.data)
9504  * elif self.free_data: # <<<<<<<<<<<<<<
9505  * if self.dtype_is_object:
9506  * refcount_objects_in_slice(self.data, self._shape,
9507  */
9508  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9509  if (__pyx_t_1) {
9510 
9511  /* "View.MemoryView":214
9512  * self.callback_free_data(self.data)
9513  * elif self.free_data:
9514  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9515  * refcount_objects_in_slice(self.data, self._shape,
9516  * self._strides, self.ndim, False)
9517  */
9518  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9519  if (__pyx_t_1) {
9520 
9521  /* "View.MemoryView":215
9522  * elif self.free_data:
9523  * if self.dtype_is_object:
9524  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9525  * self._strides, self.ndim, False)
9526  * free(self.data)
9527  */
9528  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9529 
9530  /* "View.MemoryView":214
9531  * self.callback_free_data(self.data)
9532  * elif self.free_data:
9533  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9534  * refcount_objects_in_slice(self.data, self._shape,
9535  * self._strides, self.ndim, False)
9536  */
9537  }
9538 
9539  /* "View.MemoryView":217
9540  * refcount_objects_in_slice(self.data, self._shape,
9541  * self._strides, self.ndim, False)
9542  * free(self.data) # <<<<<<<<<<<<<<
9543  * PyObject_Free(self._shape)
9544  *
9545  */
9546  free(__pyx_v_self->data);
9547 
9548  /* "View.MemoryView":213
9549  * if self.callback_free_data != NULL:
9550  * self.callback_free_data(self.data)
9551  * elif self.free_data: # <<<<<<<<<<<<<<
9552  * if self.dtype_is_object:
9553  * refcount_objects_in_slice(self.data, self._shape,
9554  */
9555  }
9556  __pyx_L3:;
9557 
9558  /* "View.MemoryView":218
9559  * self._strides, self.ndim, False)
9560  * free(self.data)
9561  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9562  *
9563  * @property
9564  */
9565  PyObject_Free(__pyx_v_self->_shape);
9566 
9567  /* "View.MemoryView":210
9568  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9569  *
9570  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9571  * if self.callback_free_data != NULL:
9572  * self.callback_free_data(self.data)
9573  */
9574 
9575  /* function exit code */
9576  __Pyx_RefNannyFinishContext();
9577 }
9578 
9579 /* "View.MemoryView":221
9580  *
9581  * @property
9582  * def memview(self): # <<<<<<<<<<<<<<
9583  * return self.get_memview()
9584  *
9585  */
9586 
9587 /* Python wrapper */
9588 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9589 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9590  PyObject *__pyx_r = 0;
9591  __Pyx_RefNannyDeclarations
9592  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9593  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9594 
9595  /* function exit code */
9596  __Pyx_RefNannyFinishContext();
9597  return __pyx_r;
9598 }
9599 
9600 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9601  PyObject *__pyx_r = NULL;
9602  __Pyx_RefNannyDeclarations
9603  PyObject *__pyx_t_1 = NULL;
9604  __Pyx_RefNannySetupContext("__get__", 0);
9605 
9606  /* "View.MemoryView":222
9607  * @property
9608  * def memview(self):
9609  * return self.get_memview() # <<<<<<<<<<<<<<
9610  *
9611  * @cname('get_memview')
9612  */
9613  __Pyx_XDECREF(__pyx_r);
9614  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
9615  __Pyx_GOTREF(__pyx_t_1);
9616  __pyx_r = __pyx_t_1;
9617  __pyx_t_1 = 0;
9618  goto __pyx_L0;
9619 
9620  /* "View.MemoryView":221
9621  *
9622  * @property
9623  * def memview(self): # <<<<<<<<<<<<<<
9624  * return self.get_memview()
9625  *
9626  */
9627 
9628  /* function exit code */
9629  __pyx_L1_error:;
9630  __Pyx_XDECREF(__pyx_t_1);
9631  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9632  __pyx_r = NULL;
9633  __pyx_L0:;
9634  __Pyx_XGIVEREF(__pyx_r);
9635  __Pyx_RefNannyFinishContext();
9636  return __pyx_r;
9637 }
9638 
9639 /* "View.MemoryView":225
9640  *
9641  * @cname('get_memview')
9642  * cdef get_memview(self): # <<<<<<<<<<<<<<
9643  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9644  * return memoryview(self, flags, self.dtype_is_object)
9645  */
9646 
9647 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9648  int __pyx_v_flags;
9649  PyObject *__pyx_r = NULL;
9650  __Pyx_RefNannyDeclarations
9651  PyObject *__pyx_t_1 = NULL;
9652  PyObject *__pyx_t_2 = NULL;
9653  PyObject *__pyx_t_3 = NULL;
9654  __Pyx_RefNannySetupContext("get_memview", 0);
9655 
9656  /* "View.MemoryView":226
9657  * @cname('get_memview')
9658  * cdef get_memview(self):
9659  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9660  * return memoryview(self, flags, self.dtype_is_object)
9661  *
9662  */
9663  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9664 
9665  /* "View.MemoryView":227
9666  * cdef get_memview(self):
9667  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9668  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9669  *
9670  * def __len__(self):
9671  */
9672  __Pyx_XDECREF(__pyx_r);
9673  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
9674  __Pyx_GOTREF(__pyx_t_1);
9675  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
9676  __Pyx_GOTREF(__pyx_t_2);
9677  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 227, __pyx_L1_error)
9678  __Pyx_GOTREF(__pyx_t_3);
9679  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9680  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9681  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9682  __Pyx_GIVEREF(__pyx_t_1);
9683  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9684  __Pyx_GIVEREF(__pyx_t_2);
9685  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9686  __pyx_t_1 = 0;
9687  __pyx_t_2 = 0;
9688  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
9689  __Pyx_GOTREF(__pyx_t_2);
9690  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9691  __pyx_r = __pyx_t_2;
9692  __pyx_t_2 = 0;
9693  goto __pyx_L0;
9694 
9695  /* "View.MemoryView":225
9696  *
9697  * @cname('get_memview')
9698  * cdef get_memview(self): # <<<<<<<<<<<<<<
9699  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9700  * return memoryview(self, flags, self.dtype_is_object)
9701  */
9702 
9703  /* function exit code */
9704  __pyx_L1_error:;
9705  __Pyx_XDECREF(__pyx_t_1);
9706  __Pyx_XDECREF(__pyx_t_2);
9707  __Pyx_XDECREF(__pyx_t_3);
9708  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9709  __pyx_r = 0;
9710  __pyx_L0:;
9711  __Pyx_XGIVEREF(__pyx_r);
9712  __Pyx_RefNannyFinishContext();
9713  return __pyx_r;
9714 }
9715 
9716 /* "View.MemoryView":229
9717  * return memoryview(self, flags, self.dtype_is_object)
9718  *
9719  * def __len__(self): # <<<<<<<<<<<<<<
9720  * return self._shape[0]
9721  *
9722  */
9723 
9724 /* Python wrapper */
9725 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9726 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9727  Py_ssize_t __pyx_r;
9728  __Pyx_RefNannyDeclarations
9729  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9730  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9731 
9732  /* function exit code */
9733  __Pyx_RefNannyFinishContext();
9734  return __pyx_r;
9735 }
9736 
9737 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9738  Py_ssize_t __pyx_r;
9739  __Pyx_RefNannyDeclarations
9740  __Pyx_RefNannySetupContext("__len__", 0);
9741 
9742  /* "View.MemoryView":230
9743  *
9744  * def __len__(self):
9745  * return self._shape[0] # <<<<<<<<<<<<<<
9746  *
9747  * def __getattr__(self, attr):
9748  */
9749  __pyx_r = (__pyx_v_self->_shape[0]);
9750  goto __pyx_L0;
9751 
9752  /* "View.MemoryView":229
9753  * return memoryview(self, flags, self.dtype_is_object)
9754  *
9755  * def __len__(self): # <<<<<<<<<<<<<<
9756  * return self._shape[0]
9757  *
9758  */
9759 
9760  /* function exit code */
9761  __pyx_L0:;
9762  __Pyx_RefNannyFinishContext();
9763  return __pyx_r;
9764 }
9765 
9766 /* "View.MemoryView":232
9767  * return self._shape[0]
9768  *
9769  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9770  * return getattr(self.memview, attr)
9771  *
9772  */
9773 
9774 /* Python wrapper */
9775 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9776 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9777  PyObject *__pyx_r = 0;
9778  __Pyx_RefNannyDeclarations
9779  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9780  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9781 
9782  /* function exit code */
9783  __Pyx_RefNannyFinishContext();
9784  return __pyx_r;
9785 }
9786 
9787 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9788  PyObject *__pyx_r = NULL;
9789  __Pyx_RefNannyDeclarations
9790  PyObject *__pyx_t_1 = NULL;
9791  PyObject *__pyx_t_2 = NULL;
9792  __Pyx_RefNannySetupContext("__getattr__", 0);
9793 
9794  /* "View.MemoryView":233
9795  *
9796  * def __getattr__(self, attr):
9797  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9798  *
9799  * def __getitem__(self, item):
9800  */
9801  __Pyx_XDECREF(__pyx_r);
9802  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
9803  __Pyx_GOTREF(__pyx_t_1);
9804  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
9805  __Pyx_GOTREF(__pyx_t_2);
9806  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9807  __pyx_r = __pyx_t_2;
9808  __pyx_t_2 = 0;
9809  goto __pyx_L0;
9810 
9811  /* "View.MemoryView":232
9812  * return self._shape[0]
9813  *
9814  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9815  * return getattr(self.memview, attr)
9816  *
9817  */
9818 
9819  /* function exit code */
9820  __pyx_L1_error:;
9821  __Pyx_XDECREF(__pyx_t_1);
9822  __Pyx_XDECREF(__pyx_t_2);
9823  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9824  __pyx_r = NULL;
9825  __pyx_L0:;
9826  __Pyx_XGIVEREF(__pyx_r);
9827  __Pyx_RefNannyFinishContext();
9828  return __pyx_r;
9829 }
9830 
9831 /* "View.MemoryView":235
9832  * return getattr(self.memview, attr)
9833  *
9834  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9835  * return self.memview[item]
9836  *
9837  */
9838 
9839 /* Python wrapper */
9840 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9841 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9842  PyObject *__pyx_r = 0;
9843  __Pyx_RefNannyDeclarations
9844  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9845  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9846 
9847  /* function exit code */
9848  __Pyx_RefNannyFinishContext();
9849  return __pyx_r;
9850 }
9851 
9852 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9853  PyObject *__pyx_r = NULL;
9854  __Pyx_RefNannyDeclarations
9855  PyObject *__pyx_t_1 = NULL;
9856  PyObject *__pyx_t_2 = NULL;
9857  __Pyx_RefNannySetupContext("__getitem__", 0);
9858 
9859  /* "View.MemoryView":236
9860  *
9861  * def __getitem__(self, item):
9862  * return self.memview[item] # <<<<<<<<<<<<<<
9863  *
9864  * def __setitem__(self, item, value):
9865  */
9866  __Pyx_XDECREF(__pyx_r);
9867  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
9868  __Pyx_GOTREF(__pyx_t_1);
9869  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error)
9870  __Pyx_GOTREF(__pyx_t_2);
9871  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9872  __pyx_r = __pyx_t_2;
9873  __pyx_t_2 = 0;
9874  goto __pyx_L0;
9875 
9876  /* "View.MemoryView":235
9877  * return getattr(self.memview, attr)
9878  *
9879  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9880  * return self.memview[item]
9881  *
9882  */
9883 
9884  /* function exit code */
9885  __pyx_L1_error:;
9886  __Pyx_XDECREF(__pyx_t_1);
9887  __Pyx_XDECREF(__pyx_t_2);
9888  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9889  __pyx_r = NULL;
9890  __pyx_L0:;
9891  __Pyx_XGIVEREF(__pyx_r);
9892  __Pyx_RefNannyFinishContext();
9893  return __pyx_r;
9894 }
9895 
9896 /* "View.MemoryView":238
9897  * return self.memview[item]
9898  *
9899  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9900  * self.memview[item] = value
9901  *
9902  */
9903 
9904 /* Python wrapper */
9905 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9906 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9907  int __pyx_r;
9908  __Pyx_RefNannyDeclarations
9909  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9910  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9911 
9912  /* function exit code */
9913  __Pyx_RefNannyFinishContext();
9914  return __pyx_r;
9915 }
9916 
9917 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9918  int __pyx_r;
9919  __Pyx_RefNannyDeclarations
9920  PyObject *__pyx_t_1 = NULL;
9921  __Pyx_RefNannySetupContext("__setitem__", 0);
9922 
9923  /* "View.MemoryView":239
9924  *
9925  * def __setitem__(self, item, value):
9926  * self.memview[item] = value # <<<<<<<<<<<<<<
9927  *
9928  *
9929  */
9930  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
9931  __Pyx_GOTREF(__pyx_t_1);
9932  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 239, __pyx_L1_error)
9933  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9934 
9935  /* "View.MemoryView":238
9936  * return self.memview[item]
9937  *
9938  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9939  * self.memview[item] = value
9940  *
9941  */
9942 
9943  /* function exit code */
9944  __pyx_r = 0;
9945  goto __pyx_L0;
9946  __pyx_L1_error:;
9947  __Pyx_XDECREF(__pyx_t_1);
9948  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9949  __pyx_r = -1;
9950  __pyx_L0:;
9951  __Pyx_RefNannyFinishContext();
9952  return __pyx_r;
9953 }
9954 
9955 /* "(tree fragment)":1
9956  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9957  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9958  * def __setstate_cython__(self, __pyx_state):
9959  */
9960 
9961 /* Python wrapper */
9962 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9963 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9964  PyObject *__pyx_r = 0;
9965  __Pyx_RefNannyDeclarations
9966  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9967  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9968 
9969  /* function exit code */
9970  __Pyx_RefNannyFinishContext();
9971  return __pyx_r;
9972 }
9973 
9974 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9975  PyObject *__pyx_r = NULL;
9976  __Pyx_RefNannyDeclarations
9977  PyObject *__pyx_t_1 = NULL;
9978  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9979 
9980  /* "(tree fragment)":2
9981  * def __reduce_cython__(self):
9982  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9983  * def __setstate_cython__(self, __pyx_state):
9984  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9985  */
9986  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9987  __Pyx_GOTREF(__pyx_t_1);
9988  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9989  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9990  __PYX_ERR(1, 2, __pyx_L1_error)
9991 
9992  /* "(tree fragment)":1
9993  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9994  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9995  * def __setstate_cython__(self, __pyx_state):
9996  */
9997 
9998  /* function exit code */
9999  __pyx_L1_error:;
10000  __Pyx_XDECREF(__pyx_t_1);
10001  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10002  __pyx_r = NULL;
10003  __Pyx_XGIVEREF(__pyx_r);
10004  __Pyx_RefNannyFinishContext();
10005  return __pyx_r;
10006 }
10007 
10008 /* "(tree fragment)":3
10009  * def __reduce_cython__(self):
10010  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10011  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10012  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10013  */
10014 
10015 /* Python wrapper */
10016 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10017 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10018  PyObject *__pyx_r = 0;
10019  __Pyx_RefNannyDeclarations
10020  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10021  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10022 
10023  /* function exit code */
10024  __Pyx_RefNannyFinishContext();
10025  return __pyx_r;
10026 }
10027 
10028 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10029  PyObject *__pyx_r = NULL;
10030  __Pyx_RefNannyDeclarations
10031  PyObject *__pyx_t_1 = NULL;
10032  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10033 
10034  /* "(tree fragment)":4
10035  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10036  * def __setstate_cython__(self, __pyx_state):
10037  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10038  */
10039  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10040  __Pyx_GOTREF(__pyx_t_1);
10041  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10042  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10043  __PYX_ERR(1, 4, __pyx_L1_error)
10044 
10045  /* "(tree fragment)":3
10046  * def __reduce_cython__(self):
10047  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10048  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10049  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10050  */
10051 
10052  /* function exit code */
10053  __pyx_L1_error:;
10054  __Pyx_XDECREF(__pyx_t_1);
10055  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10056  __pyx_r = NULL;
10057  __Pyx_XGIVEREF(__pyx_r);
10058  __Pyx_RefNannyFinishContext();
10059  return __pyx_r;
10060 }
10061 
10062 /* "View.MemoryView":243
10063  *
10064  * @cname("__pyx_array_new")
10065  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10066  * char *mode, char *buf):
10067  * cdef array result
10068  */
10069 
10070 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
10071  struct __pyx_array_obj *__pyx_v_result = 0;
10072  struct __pyx_array_obj *__pyx_r = NULL;
10073  __Pyx_RefNannyDeclarations
10074  int __pyx_t_1;
10075  PyObject *__pyx_t_2 = NULL;
10076  PyObject *__pyx_t_3 = NULL;
10077  PyObject *__pyx_t_4 = NULL;
10078  PyObject *__pyx_t_5 = NULL;
10079  __Pyx_RefNannySetupContext("array_cwrapper", 0);
10080 
10081  /* "View.MemoryView":247
10082  * cdef array result
10083  *
10084  * if buf == NULL: # <<<<<<<<<<<<<<
10085  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10086  * else:
10087  */
10088  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10089  if (__pyx_t_1) {
10090 
10091  /* "View.MemoryView":248
10092  *
10093  * if buf == NULL:
10094  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10095  * else:
10096  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10097  */
10098  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
10099  __Pyx_GOTREF(__pyx_t_2);
10100  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
10101  __Pyx_GOTREF(__pyx_t_3);
10102  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
10103  __Pyx_GOTREF(__pyx_t_4);
10104  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 248, __pyx_L1_error)
10105  __Pyx_GOTREF(__pyx_t_5);
10106  __Pyx_INCREF(__pyx_v_shape);
10107  __Pyx_GIVEREF(__pyx_v_shape);
10108  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10109  __Pyx_GIVEREF(__pyx_t_2);
10110  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10111  __Pyx_GIVEREF(__pyx_t_3);
10112  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10113  __Pyx_GIVEREF(__pyx_t_4);
10114  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10115  __pyx_t_2 = 0;
10116  __pyx_t_3 = 0;
10117  __pyx_t_4 = 0;
10118  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
10119  __Pyx_GOTREF(__pyx_t_4);
10120  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10121  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
10122  __pyx_t_4 = 0;
10123 
10124  /* "View.MemoryView":247
10125  * cdef array result
10126  *
10127  * if buf == NULL: # <<<<<<<<<<<<<<
10128  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10129  * else:
10130  */
10131  goto __pyx_L3;
10132  }
10133 
10134  /* "View.MemoryView":250
10135  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10136  * else:
10137  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10138  * allocate_buffer=False)
10139  * result.data = buf
10140  */
10141  /*else*/ {
10142  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
10143  __Pyx_GOTREF(__pyx_t_4);
10144  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
10145  __Pyx_GOTREF(__pyx_t_5);
10146  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
10147  __Pyx_GOTREF(__pyx_t_3);
10148  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
10149  __Pyx_GOTREF(__pyx_t_2);
10150  __Pyx_INCREF(__pyx_v_shape);
10151  __Pyx_GIVEREF(__pyx_v_shape);
10152  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10153  __Pyx_GIVEREF(__pyx_t_4);
10154  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10155  __Pyx_GIVEREF(__pyx_t_5);
10156  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10157  __Pyx_GIVEREF(__pyx_t_3);
10158  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10159  __pyx_t_4 = 0;
10160  __pyx_t_5 = 0;
10161  __pyx_t_3 = 0;
10162 
10163  /* "View.MemoryView":251
10164  * else:
10165  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10166  * allocate_buffer=False) # <<<<<<<<<<<<<<
10167  * result.data = buf
10168  *
10169  */
10170  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10171  __Pyx_GOTREF(__pyx_t_3);
10172  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 251, __pyx_L1_error)
10173 
10174  /* "View.MemoryView":250
10175  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10176  * else:
10177  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10178  * allocate_buffer=False)
10179  * result.data = buf
10180  */
10181  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
10182  __Pyx_GOTREF(__pyx_t_5);
10183  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10184  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10185  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10186  __pyx_t_5 = 0;
10187 
10188  /* "View.MemoryView":252
10189  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10190  * allocate_buffer=False)
10191  * result.data = buf # <<<<<<<<<<<<<<
10192  *
10193  * return result
10194  */
10195  __pyx_v_result->data = __pyx_v_buf;
10196  }
10197  __pyx_L3:;
10198 
10199  /* "View.MemoryView":254
10200  * result.data = buf
10201  *
10202  * return result # <<<<<<<<<<<<<<
10203  *
10204  *
10205  */
10206  __Pyx_XDECREF(((PyObject *)__pyx_r));
10207  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10208  __pyx_r = __pyx_v_result;
10209  goto __pyx_L0;
10210 
10211  /* "View.MemoryView":243
10212  *
10213  * @cname("__pyx_array_new")
10214  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10215  * char *mode, char *buf):
10216  * cdef array result
10217  */
10218 
10219  /* function exit code */
10220  __pyx_L1_error:;
10221  __Pyx_XDECREF(__pyx_t_2);
10222  __Pyx_XDECREF(__pyx_t_3);
10223  __Pyx_XDECREF(__pyx_t_4);
10224  __Pyx_XDECREF(__pyx_t_5);
10225  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10226  __pyx_r = 0;
10227  __pyx_L0:;
10228  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10229  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10230  __Pyx_RefNannyFinishContext();
10231  return __pyx_r;
10232 }
10233 
10234 /* "View.MemoryView":280
10235  * cdef class Enum(object):
10236  * cdef object name
10237  * def __init__(self, name): # <<<<<<<<<<<<<<
10238  * self.name = name
10239  * def __repr__(self):
10240  */
10241 
10242 /* Python wrapper */
10243 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10244 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10245  PyObject *__pyx_v_name = 0;
10246  int __pyx_r;
10247  __Pyx_RefNannyDeclarations
10248  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10249  {
10250  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10251  PyObject* values[1] = {0};
10252  if (unlikely(__pyx_kwds)) {
10253  Py_ssize_t kw_args;
10254  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10255  switch (pos_args) {
10256  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10257  CYTHON_FALLTHROUGH;
10258  case 0: break;
10259  default: goto __pyx_L5_argtuple_error;
10260  }
10261  kw_args = PyDict_Size(__pyx_kwds);
10262  switch (pos_args) {
10263  case 0:
10264  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10265  else goto __pyx_L5_argtuple_error;
10266  }
10267  if (unlikely(kw_args > 0)) {
10268  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 280, __pyx_L3_error)
10269  }
10270  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10271  goto __pyx_L5_argtuple_error;
10272  } else {
10273  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10274  }
10275  __pyx_v_name = values[0];
10276  }
10277  goto __pyx_L4_argument_unpacking_done;
10278  __pyx_L5_argtuple_error:;
10279  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 280, __pyx_L3_error)
10280  __pyx_L3_error:;
10281  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10282  __Pyx_RefNannyFinishContext();
10283  return -1;
10284  __pyx_L4_argument_unpacking_done:;
10285  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10286 
10287  /* function exit code */
10288  __Pyx_RefNannyFinishContext();
10289  return __pyx_r;
10290 }
10291 
10292 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10293  int __pyx_r;
10294  __Pyx_RefNannyDeclarations
10295  __Pyx_RefNannySetupContext("__init__", 0);
10296 
10297  /* "View.MemoryView":281
10298  * cdef object name
10299  * def __init__(self, name):
10300  * self.name = name # <<<<<<<<<<<<<<
10301  * def __repr__(self):
10302  * return self.name
10303  */
10304  __Pyx_INCREF(__pyx_v_name);
10305  __Pyx_GIVEREF(__pyx_v_name);
10306  __Pyx_GOTREF(__pyx_v_self->name);
10307  __Pyx_DECREF(__pyx_v_self->name);
10308  __pyx_v_self->name = __pyx_v_name;
10309 
10310  /* "View.MemoryView":280
10311  * cdef class Enum(object):
10312  * cdef object name
10313  * def __init__(self, name): # <<<<<<<<<<<<<<
10314  * self.name = name
10315  * def __repr__(self):
10316  */
10317 
10318  /* function exit code */
10319  __pyx_r = 0;
10320  __Pyx_RefNannyFinishContext();
10321  return __pyx_r;
10322 }
10323 
10324 /* "View.MemoryView":282
10325  * def __init__(self, name):
10326  * self.name = name
10327  * def __repr__(self): # <<<<<<<<<<<<<<
10328  * return self.name
10329  *
10330  */
10331 
10332 /* Python wrapper */
10333 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10334 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10335  PyObject *__pyx_r = 0;
10336  __Pyx_RefNannyDeclarations
10337  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10338  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10339 
10340  /* function exit code */
10341  __Pyx_RefNannyFinishContext();
10342  return __pyx_r;
10343 }
10344 
10345 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10346  PyObject *__pyx_r = NULL;
10347  __Pyx_RefNannyDeclarations
10348  __Pyx_RefNannySetupContext("__repr__", 0);
10349 
10350  /* "View.MemoryView":283
10351  * self.name = name
10352  * def __repr__(self):
10353  * return self.name # <<<<<<<<<<<<<<
10354  *
10355  * cdef generic = Enum("<strided and direct or indirect>")
10356  */
10357  __Pyx_XDECREF(__pyx_r);
10358  __Pyx_INCREF(__pyx_v_self->name);
10359  __pyx_r = __pyx_v_self->name;
10360  goto __pyx_L0;
10361 
10362  /* "View.MemoryView":282
10363  * def __init__(self, name):
10364  * self.name = name
10365  * def __repr__(self): # <<<<<<<<<<<<<<
10366  * return self.name
10367  *
10368  */
10369 
10370  /* function exit code */
10371  __pyx_L0:;
10372  __Pyx_XGIVEREF(__pyx_r);
10373  __Pyx_RefNannyFinishContext();
10374  return __pyx_r;
10375 }
10376 
10377 /* "(tree fragment)":1
10378  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10379  * cdef bint use_setstate
10380  * state = (self.name,)
10381  */
10382 
10383 /* Python wrapper */
10384 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10385 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10386  PyObject *__pyx_r = 0;
10387  __Pyx_RefNannyDeclarations
10388  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10389  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10390 
10391  /* function exit code */
10392  __Pyx_RefNannyFinishContext();
10393  return __pyx_r;
10394 }
10395 
10396 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10397  int __pyx_v_use_setstate;
10398  PyObject *__pyx_v_state = NULL;
10399  PyObject *__pyx_v__dict = NULL;
10400  PyObject *__pyx_r = NULL;
10401  __Pyx_RefNannyDeclarations
10402  PyObject *__pyx_t_1 = NULL;
10403  int __pyx_t_2;
10404  int __pyx_t_3;
10405  PyObject *__pyx_t_4 = NULL;
10406  PyObject *__pyx_t_5 = NULL;
10407  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10408 
10409  /* "(tree fragment)":3
10410  * def __reduce_cython__(self):
10411  * cdef bint use_setstate
10412  * state = (self.name,) # <<<<<<<<<<<<<<
10413  * _dict = getattr(self, '__dict__', None)
10414  * if _dict is not None:
10415  */
10416  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
10417  __Pyx_GOTREF(__pyx_t_1);
10418  __Pyx_INCREF(__pyx_v_self->name);
10419  __Pyx_GIVEREF(__pyx_v_self->name);
10420  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10421  __pyx_v_state = ((PyObject*)__pyx_t_1);
10422  __pyx_t_1 = 0;
10423 
10424  /* "(tree fragment)":4
10425  * cdef bint use_setstate
10426  * state = (self.name,)
10427  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10428  * if _dict is not None:
10429  * state += (_dict,)
10430  */
10431  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10432  __Pyx_GOTREF(__pyx_t_1);
10433  __pyx_v__dict = __pyx_t_1;
10434  __pyx_t_1 = 0;
10435 
10436  /* "(tree fragment)":5
10437  * state = (self.name,)
10438  * _dict = getattr(self, '__dict__', None)
10439  * if _dict is not None: # <<<<<<<<<<<<<<
10440  * state += (_dict,)
10441  * use_setstate = True
10442  */
10443  __pyx_t_2 = (__pyx_v__dict != Py_None);
10444  __pyx_t_3 = (__pyx_t_2 != 0);
10445  if (__pyx_t_3) {
10446 
10447  /* "(tree fragment)":6
10448  * _dict = getattr(self, '__dict__', None)
10449  * if _dict is not None:
10450  * state += (_dict,) # <<<<<<<<<<<<<<
10451  * use_setstate = True
10452  * else:
10453  */
10454  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10455  __Pyx_GOTREF(__pyx_t_1);
10456  __Pyx_INCREF(__pyx_v__dict);
10457  __Pyx_GIVEREF(__pyx_v__dict);
10458  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10459  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
10460  __Pyx_GOTREF(__pyx_t_4);
10461  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10462  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10463  __pyx_t_4 = 0;
10464 
10465  /* "(tree fragment)":7
10466  * if _dict is not None:
10467  * state += (_dict,)
10468  * use_setstate = True # <<<<<<<<<<<<<<
10469  * else:
10470  * use_setstate = self.name is not None
10471  */
10472  __pyx_v_use_setstate = 1;
10473 
10474  /* "(tree fragment)":5
10475  * state = (self.name,)
10476  * _dict = getattr(self, '__dict__', None)
10477  * if _dict is not None: # <<<<<<<<<<<<<<
10478  * state += (_dict,)
10479  * use_setstate = True
10480  */
10481  goto __pyx_L3;
10482  }
10483 
10484  /* "(tree fragment)":9
10485  * use_setstate = True
10486  * else:
10487  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10488  * if use_setstate:
10489  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10490  */
10491  /*else*/ {
10492  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10493  __pyx_v_use_setstate = __pyx_t_3;
10494  }
10495  __pyx_L3:;
10496 
10497  /* "(tree fragment)":10
10498  * else:
10499  * use_setstate = self.name is not None
10500  * if use_setstate: # <<<<<<<<<<<<<<
10501  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10502  * else:
10503  */
10504  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10505  if (__pyx_t_3) {
10506 
10507  /* "(tree fragment)":11
10508  * use_setstate = self.name is not None
10509  * if use_setstate:
10510  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10511  * else:
10512  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10513  */
10514  __Pyx_XDECREF(__pyx_r);
10515  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error)
10516  __Pyx_GOTREF(__pyx_t_4);
10517  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
10518  __Pyx_GOTREF(__pyx_t_1);
10519  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10520  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10521  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10522  __Pyx_INCREF(__pyx_int_184977713);
10523  __Pyx_GIVEREF(__pyx_int_184977713);
10524  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10525  __Pyx_INCREF(Py_None);
10526  __Pyx_GIVEREF(Py_None);
10527  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10528  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error)
10529  __Pyx_GOTREF(__pyx_t_5);
10530  __Pyx_GIVEREF(__pyx_t_4);
10531  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10532  __Pyx_GIVEREF(__pyx_t_1);
10533  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10534  __Pyx_INCREF(__pyx_v_state);
10535  __Pyx_GIVEREF(__pyx_v_state);
10536  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10537  __pyx_t_4 = 0;
10538  __pyx_t_1 = 0;
10539  __pyx_r = __pyx_t_5;
10540  __pyx_t_5 = 0;
10541  goto __pyx_L0;
10542 
10543  /* "(tree fragment)":10
10544  * else:
10545  * use_setstate = self.name is not None
10546  * if use_setstate: # <<<<<<<<<<<<<<
10547  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10548  * else:
10549  */
10550  }
10551 
10552  /* "(tree fragment)":13
10553  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10554  * else:
10555  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10556  * def __setstate_cython__(self, __pyx_state):
10557  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10558  */
10559  /*else*/ {
10560  __Pyx_XDECREF(__pyx_r);
10561  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10562  __Pyx_GOTREF(__pyx_t_5);
10563  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10564  __Pyx_GOTREF(__pyx_t_1);
10565  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10566  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10567  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10568  __Pyx_INCREF(__pyx_int_184977713);
10569  __Pyx_GIVEREF(__pyx_int_184977713);
10570  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10571  __Pyx_INCREF(__pyx_v_state);
10572  __Pyx_GIVEREF(__pyx_v_state);
10573  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10574  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10575  __Pyx_GOTREF(__pyx_t_4);
10576  __Pyx_GIVEREF(__pyx_t_5);
10577  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10578  __Pyx_GIVEREF(__pyx_t_1);
10579  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10580  __pyx_t_5 = 0;
10581  __pyx_t_1 = 0;
10582  __pyx_r = __pyx_t_4;
10583  __pyx_t_4 = 0;
10584  goto __pyx_L0;
10585  }
10586 
10587  /* "(tree fragment)":1
10588  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10589  * cdef bint use_setstate
10590  * state = (self.name,)
10591  */
10592 
10593  /* function exit code */
10594  __pyx_L1_error:;
10595  __Pyx_XDECREF(__pyx_t_1);
10596  __Pyx_XDECREF(__pyx_t_4);
10597  __Pyx_XDECREF(__pyx_t_5);
10598  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10599  __pyx_r = NULL;
10600  __pyx_L0:;
10601  __Pyx_XDECREF(__pyx_v_state);
10602  __Pyx_XDECREF(__pyx_v__dict);
10603  __Pyx_XGIVEREF(__pyx_r);
10604  __Pyx_RefNannyFinishContext();
10605  return __pyx_r;
10606 }
10607 
10608 /* "(tree fragment)":14
10609  * else:
10610  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10611  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10612  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10613  */
10614 
10615 /* Python wrapper */
10616 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10617 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10618  PyObject *__pyx_r = 0;
10619  __Pyx_RefNannyDeclarations
10620  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10621  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10622 
10623  /* function exit code */
10624  __Pyx_RefNannyFinishContext();
10625  return __pyx_r;
10626 }
10627 
10628 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10629  PyObject *__pyx_r = NULL;
10630  __Pyx_RefNannyDeclarations
10631  PyObject *__pyx_t_1 = NULL;
10632  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10633 
10634  /* "(tree fragment)":15
10635  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10636  * def __setstate_cython__(self, __pyx_state):
10637  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10638  */
10639  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
10640  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10641  __Pyx_GOTREF(__pyx_t_1);
10642  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10643 
10644  /* "(tree fragment)":14
10645  * else:
10646  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10647  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10648  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10649  */
10650 
10651  /* function exit code */
10652  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10653  goto __pyx_L0;
10654  __pyx_L1_error:;
10655  __Pyx_XDECREF(__pyx_t_1);
10656  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10657  __pyx_r = NULL;
10658  __pyx_L0:;
10659  __Pyx_XGIVEREF(__pyx_r);
10660  __Pyx_RefNannyFinishContext();
10661  return __pyx_r;
10662 }
10663 
10664 /* "View.MemoryView":297
10665  *
10666  * @cname('__pyx_align_pointer')
10667  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10668  * "Align pointer memory on a given boundary"
10669  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10670  */
10671 
10672 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10673  Py_intptr_t __pyx_v_aligned_p;
10674  size_t __pyx_v_offset;
10675  void *__pyx_r;
10676  int __pyx_t_1;
10677 
10678  /* "View.MemoryView":299
10679  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10680  * "Align pointer memory on a given boundary"
10681  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10682  * cdef size_t offset
10683  *
10684  */
10685  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10686 
10687  /* "View.MemoryView":303
10688  *
10689  * with cython.cdivision(True):
10690  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10691  *
10692  * if offset > 0:
10693  */
10694  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10695 
10696  /* "View.MemoryView":305
10697  * offset = aligned_p % alignment
10698  *
10699  * if offset > 0: # <<<<<<<<<<<<<<
10700  * aligned_p += alignment - offset
10701  *
10702  */
10703  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10704  if (__pyx_t_1) {
10705 
10706  /* "View.MemoryView":306
10707  *
10708  * if offset > 0:
10709  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10710  *
10711  * return <void *> aligned_p
10712  */
10713  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10714 
10715  /* "View.MemoryView":305
10716  * offset = aligned_p % alignment
10717  *
10718  * if offset > 0: # <<<<<<<<<<<<<<
10719  * aligned_p += alignment - offset
10720  *
10721  */
10722  }
10723 
10724  /* "View.MemoryView":308
10725  * aligned_p += alignment - offset
10726  *
10727  * return <void *> aligned_p # <<<<<<<<<<<<<<
10728  *
10729  *
10730  */
10731  __pyx_r = ((void *)__pyx_v_aligned_p);
10732  goto __pyx_L0;
10733 
10734  /* "View.MemoryView":297
10735  *
10736  * @cname('__pyx_align_pointer')
10737  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10738  * "Align pointer memory on a given boundary"
10739  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10740  */
10741 
10742  /* function exit code */
10743  __pyx_L0:;
10744  return __pyx_r;
10745 }
10746 
10747 /* "View.MemoryView":344
10748  * cdef __Pyx_TypeInfo *typeinfo
10749  *
10750  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10751  * self.obj = obj
10752  * self.flags = flags
10753  */
10754 
10755 /* Python wrapper */
10756 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10757 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10758  PyObject *__pyx_v_obj = 0;
10759  int __pyx_v_flags;
10760  int __pyx_v_dtype_is_object;
10761  int __pyx_r;
10762  __Pyx_RefNannyDeclarations
10763  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10764  {
10765  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10766  PyObject* values[3] = {0,0,0};
10767  if (unlikely(__pyx_kwds)) {
10768  Py_ssize_t kw_args;
10769  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10770  switch (pos_args) {
10771  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10772  CYTHON_FALLTHROUGH;
10773  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10774  CYTHON_FALLTHROUGH;
10775  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10776  CYTHON_FALLTHROUGH;
10777  case 0: break;
10778  default: goto __pyx_L5_argtuple_error;
10779  }
10780  kw_args = PyDict_Size(__pyx_kwds);
10781  switch (pos_args) {
10782  case 0:
10783  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10784  else goto __pyx_L5_argtuple_error;
10785  CYTHON_FALLTHROUGH;
10786  case 1:
10787  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10788  else {
10789  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 344, __pyx_L3_error)
10790  }
10791  CYTHON_FALLTHROUGH;
10792  case 2:
10793  if (kw_args > 0) {
10794  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10795  if (value) { values[2] = value; kw_args--; }
10796  }
10797  }
10798  if (unlikely(kw_args > 0)) {
10799  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 344, __pyx_L3_error)
10800  }
10801  } else {
10802  switch (PyTuple_GET_SIZE(__pyx_args)) {
10803  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10804  CYTHON_FALLTHROUGH;
10805  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10806  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10807  break;
10808  default: goto __pyx_L5_argtuple_error;
10809  }
10810  }
10811  __pyx_v_obj = values[0];
10812  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
10813  if (values[2]) {
10814  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
10815  } else {
10816  __pyx_v_dtype_is_object = ((int)0);
10817  }
10818  }
10819  goto __pyx_L4_argument_unpacking_done;
10820  __pyx_L5_argtuple_error:;
10821  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error)
10822  __pyx_L3_error:;
10823  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10824  __Pyx_RefNannyFinishContext();
10825  return -1;
10826  __pyx_L4_argument_unpacking_done:;
10827  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10828 
10829  /* function exit code */
10830  __Pyx_RefNannyFinishContext();
10831  return __pyx_r;
10832 }
10833 
10834 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10835  int __pyx_r;
10836  __Pyx_RefNannyDeclarations
10837  int __pyx_t_1;
10838  int __pyx_t_2;
10839  int __pyx_t_3;
10840  int __pyx_t_4;
10841  __Pyx_RefNannySetupContext("__cinit__", 0);
10842 
10843  /* "View.MemoryView":345
10844  *
10845  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10846  * self.obj = obj # <<<<<<<<<<<<<<
10847  * self.flags = flags
10848  * if type(self) is memoryview or obj is not None:
10849  */
10850  __Pyx_INCREF(__pyx_v_obj);
10851  __Pyx_GIVEREF(__pyx_v_obj);
10852  __Pyx_GOTREF(__pyx_v_self->obj);
10853  __Pyx_DECREF(__pyx_v_self->obj);
10854  __pyx_v_self->obj = __pyx_v_obj;
10855 
10856  /* "View.MemoryView":346
10857  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10858  * self.obj = obj
10859  * self.flags = flags # <<<<<<<<<<<<<<
10860  * if type(self) is memoryview or obj is not None:
10861  * __Pyx_GetBuffer(obj, &self.view, flags)
10862  */
10863  __pyx_v_self->flags = __pyx_v_flags;
10864 
10865  /* "View.MemoryView":347
10866  * self.obj = obj
10867  * self.flags = flags
10868  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10869  * __Pyx_GetBuffer(obj, &self.view, flags)
10870  * if <PyObject *> self.view.obj == NULL:
10871  */
10872  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10873  __pyx_t_3 = (__pyx_t_2 != 0);
10874  if (!__pyx_t_3) {
10875  } else {
10876  __pyx_t_1 = __pyx_t_3;
10877  goto __pyx_L4_bool_binop_done;
10878  }
10879  __pyx_t_3 = (__pyx_v_obj != Py_None);
10880  __pyx_t_2 = (__pyx_t_3 != 0);
10881  __pyx_t_1 = __pyx_t_2;
10882  __pyx_L4_bool_binop_done:;
10883  if (__pyx_t_1) {
10884 
10885  /* "View.MemoryView":348
10886  * self.flags = flags
10887  * if type(self) is memoryview or obj is not None:
10888  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10889  * if <PyObject *> self.view.obj == NULL:
10890  * (<__pyx_buffer *> &self.view).obj = Py_None
10891  */
10892  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 348, __pyx_L1_error)
10893 
10894  /* "View.MemoryView":349
10895  * if type(self) is memoryview or obj is not None:
10896  * __Pyx_GetBuffer(obj, &self.view, flags)
10897  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10898  * (<__pyx_buffer *> &self.view).obj = Py_None
10899  * Py_INCREF(Py_None)
10900  */
10901  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10902  if (__pyx_t_1) {
10903 
10904  /* "View.MemoryView":350
10905  * __Pyx_GetBuffer(obj, &self.view, flags)
10906  * if <PyObject *> self.view.obj == NULL:
10907  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10908  * Py_INCREF(Py_None)
10909  *
10910  */
10911  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10912 
10913  /* "View.MemoryView":351
10914  * if <PyObject *> self.view.obj == NULL:
10915  * (<__pyx_buffer *> &self.view).obj = Py_None
10916  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10917  *
10918  * global __pyx_memoryview_thread_locks_used
10919  */
10920  Py_INCREF(Py_None);
10921 
10922  /* "View.MemoryView":349
10923  * if type(self) is memoryview or obj is not None:
10924  * __Pyx_GetBuffer(obj, &self.view, flags)
10925  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10926  * (<__pyx_buffer *> &self.view).obj = Py_None
10927  * Py_INCREF(Py_None)
10928  */
10929  }
10930 
10931  /* "View.MemoryView":347
10932  * self.obj = obj
10933  * self.flags = flags
10934  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10935  * __Pyx_GetBuffer(obj, &self.view, flags)
10936  * if <PyObject *> self.view.obj == NULL:
10937  */
10938  }
10939 
10940  /* "View.MemoryView":354
10941  *
10942  * global __pyx_memoryview_thread_locks_used
10943  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10944  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10945  * __pyx_memoryview_thread_locks_used += 1
10946  */
10947  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10948  if (__pyx_t_1) {
10949 
10950  /* "View.MemoryView":355
10951  * global __pyx_memoryview_thread_locks_used
10952  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10953  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10954  * __pyx_memoryview_thread_locks_used += 1
10955  * if self.lock is NULL:
10956  */
10957  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10958 
10959  /* "View.MemoryView":356
10960  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10961  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10962  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10963  * if self.lock is NULL:
10964  * self.lock = PyThread_allocate_lock()
10965  */
10966  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10967 
10968  /* "View.MemoryView":354
10969  *
10970  * global __pyx_memoryview_thread_locks_used
10971  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10972  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10973  * __pyx_memoryview_thread_locks_used += 1
10974  */
10975  }
10976 
10977  /* "View.MemoryView":357
10978  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10979  * __pyx_memoryview_thread_locks_used += 1
10980  * if self.lock is NULL: # <<<<<<<<<<<<<<
10981  * self.lock = PyThread_allocate_lock()
10982  * if self.lock is NULL:
10983  */
10984  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10985  if (__pyx_t_1) {
10986 
10987  /* "View.MemoryView":358
10988  * __pyx_memoryview_thread_locks_used += 1
10989  * if self.lock is NULL:
10990  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10991  * if self.lock is NULL:
10992  * raise MemoryError
10993  */
10994  __pyx_v_self->lock = PyThread_allocate_lock();
10995 
10996  /* "View.MemoryView":359
10997  * if self.lock is NULL:
10998  * self.lock = PyThread_allocate_lock()
10999  * if self.lock is NULL: # <<<<<<<<<<<<<<
11000  * raise MemoryError
11001  *
11002  */
11003  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11004  if (unlikely(__pyx_t_1)) {
11005 
11006  /* "View.MemoryView":360
11007  * self.lock = PyThread_allocate_lock()
11008  * if self.lock is NULL:
11009  * raise MemoryError # <<<<<<<<<<<<<<
11010  *
11011  * if flags & PyBUF_FORMAT:
11012  */
11013  PyErr_NoMemory(); __PYX_ERR(1, 360, __pyx_L1_error)
11014 
11015  /* "View.MemoryView":359
11016  * if self.lock is NULL:
11017  * self.lock = PyThread_allocate_lock()
11018  * if self.lock is NULL: # <<<<<<<<<<<<<<
11019  * raise MemoryError
11020  *
11021  */
11022  }
11023 
11024  /* "View.MemoryView":357
11025  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11026  * __pyx_memoryview_thread_locks_used += 1
11027  * if self.lock is NULL: # <<<<<<<<<<<<<<
11028  * self.lock = PyThread_allocate_lock()
11029  * if self.lock is NULL:
11030  */
11031  }
11032 
11033  /* "View.MemoryView":362
11034  * raise MemoryError
11035  *
11036  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11037  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11038  * else:
11039  */
11040  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11041  if (__pyx_t_1) {
11042 
11043  /* "View.MemoryView":363
11044  *
11045  * if flags & PyBUF_FORMAT:
11046  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
11047  * else:
11048  * self.dtype_is_object = dtype_is_object
11049  */
11050  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
11051  if (__pyx_t_2) {
11052  } else {
11053  __pyx_t_1 = __pyx_t_2;
11054  goto __pyx_L11_bool_binop_done;
11055  }
11056  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
11057  __pyx_t_1 = __pyx_t_2;
11058  __pyx_L11_bool_binop_done:;
11059  __pyx_v_self->dtype_is_object = __pyx_t_1;
11060 
11061  /* "View.MemoryView":362
11062  * raise MemoryError
11063  *
11064  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11065  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11066  * else:
11067  */
11068  goto __pyx_L10;
11069  }
11070 
11071  /* "View.MemoryView":365
11072  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11073  * else:
11074  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
11075  *
11076  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11077  */
11078  /*else*/ {
11079  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11080  }
11081  __pyx_L10:;
11082 
11083  /* "View.MemoryView":367
11084  * self.dtype_is_object = dtype_is_object
11085  *
11086  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11087  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11088  * self.typeinfo = NULL
11089  */
11090  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11091 
11092  /* "View.MemoryView":369
11093  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11094  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11095  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11096  *
11097  * def __dealloc__(memoryview self):
11098  */
11099  __pyx_v_self->typeinfo = NULL;
11100 
11101  /* "View.MemoryView":344
11102  * cdef __Pyx_TypeInfo *typeinfo
11103  *
11104  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11105  * self.obj = obj
11106  * self.flags = flags
11107  */
11108 
11109  /* function exit code */
11110  __pyx_r = 0;
11111  goto __pyx_L0;
11112  __pyx_L1_error:;
11113  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11114  __pyx_r = -1;
11115  __pyx_L0:;
11116  __Pyx_RefNannyFinishContext();
11117  return __pyx_r;
11118 }
11119 
11120 /* "View.MemoryView":371
11121  * self.typeinfo = NULL
11122  *
11123  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11124  * if self.obj is not None:
11125  * __Pyx_ReleaseBuffer(&self.view)
11126  */
11127 
11128 /* Python wrapper */
11129 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11130 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11131  __Pyx_RefNannyDeclarations
11132  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11133  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11134 
11135  /* function exit code */
11136  __Pyx_RefNannyFinishContext();
11137 }
11138 
11139 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11140  int __pyx_v_i;
11141  __Pyx_RefNannyDeclarations
11142  int __pyx_t_1;
11143  int __pyx_t_2;
11144  int __pyx_t_3;
11145  int __pyx_t_4;
11146  int __pyx_t_5;
11147  PyThread_type_lock __pyx_t_6;
11148  PyThread_type_lock __pyx_t_7;
11149  __Pyx_RefNannySetupContext("__dealloc__", 0);
11150 
11151  /* "View.MemoryView":372
11152  *
11153  * def __dealloc__(memoryview self):
11154  * if self.obj is not None: # <<<<<<<<<<<<<<
11155  * __Pyx_ReleaseBuffer(&self.view)
11156  *
11157  */
11158  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11159  __pyx_t_2 = (__pyx_t_1 != 0);
11160  if (__pyx_t_2) {
11161 
11162  /* "View.MemoryView":373
11163  * def __dealloc__(memoryview self):
11164  * if self.obj is not None:
11165  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11166  *
11167  * cdef int i
11168  */
11169  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11170 
11171  /* "View.MemoryView":372
11172  *
11173  * def __dealloc__(memoryview self):
11174  * if self.obj is not None: # <<<<<<<<<<<<<<
11175  * __Pyx_ReleaseBuffer(&self.view)
11176  *
11177  */
11178  }
11179 
11180  /* "View.MemoryView":377
11181  * cdef int i
11182  * global __pyx_memoryview_thread_locks_used
11183  * if self.lock != NULL: # <<<<<<<<<<<<<<
11184  * for i in range(__pyx_memoryview_thread_locks_used):
11185  * if __pyx_memoryview_thread_locks[i] is self.lock:
11186  */
11187  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11188  if (__pyx_t_2) {
11189 
11190  /* "View.MemoryView":378
11191  * global __pyx_memoryview_thread_locks_used
11192  * if self.lock != NULL:
11193  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11194  * if __pyx_memoryview_thread_locks[i] is self.lock:
11195  * __pyx_memoryview_thread_locks_used -= 1
11196  */
11197  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11198  __pyx_t_4 = __pyx_t_3;
11199  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11200  __pyx_v_i = __pyx_t_5;
11201 
11202  /* "View.MemoryView":379
11203  * if self.lock != NULL:
11204  * for i in range(__pyx_memoryview_thread_locks_used):
11205  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11206  * __pyx_memoryview_thread_locks_used -= 1
11207  * if i != __pyx_memoryview_thread_locks_used:
11208  */
11209  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11210  if (__pyx_t_2) {
11211 
11212  /* "View.MemoryView":380
11213  * for i in range(__pyx_memoryview_thread_locks_used):
11214  * if __pyx_memoryview_thread_locks[i] is self.lock:
11215  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11216  * if i != __pyx_memoryview_thread_locks_used:
11217  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11218  */
11219  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11220 
11221  /* "View.MemoryView":381
11222  * if __pyx_memoryview_thread_locks[i] is self.lock:
11223  * __pyx_memoryview_thread_locks_used -= 1
11224  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11225  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11226  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11227  */
11228  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11229  if (__pyx_t_2) {
11230 
11231  /* "View.MemoryView":383
11232  * if i != __pyx_memoryview_thread_locks_used:
11233  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11234  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11235  * break
11236  * else:
11237  */
11238  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11239  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11240 
11241  /* "View.MemoryView":382
11242  * __pyx_memoryview_thread_locks_used -= 1
11243  * if i != __pyx_memoryview_thread_locks_used:
11244  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11245  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11246  * break
11247  */
11248  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11249  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11250 
11251  /* "View.MemoryView":381
11252  * if __pyx_memoryview_thread_locks[i] is self.lock:
11253  * __pyx_memoryview_thread_locks_used -= 1
11254  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11255  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11256  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11257  */
11258  }
11259 
11260  /* "View.MemoryView":384
11261  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11262  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11263  * break # <<<<<<<<<<<<<<
11264  * else:
11265  * PyThread_free_lock(self.lock)
11266  */
11267  goto __pyx_L6_break;
11268 
11269  /* "View.MemoryView":379
11270  * if self.lock != NULL:
11271  * for i in range(__pyx_memoryview_thread_locks_used):
11272  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11273  * __pyx_memoryview_thread_locks_used -= 1
11274  * if i != __pyx_memoryview_thread_locks_used:
11275  */
11276  }
11277  }
11278  /*else*/ {
11279 
11280  /* "View.MemoryView":386
11281  * break
11282  * else:
11283  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11284  *
11285  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11286  */
11287  PyThread_free_lock(__pyx_v_self->lock);
11288  }
11289  __pyx_L6_break:;
11290 
11291  /* "View.MemoryView":377
11292  * cdef int i
11293  * global __pyx_memoryview_thread_locks_used
11294  * if self.lock != NULL: # <<<<<<<<<<<<<<
11295  * for i in range(__pyx_memoryview_thread_locks_used):
11296  * if __pyx_memoryview_thread_locks[i] is self.lock:
11297  */
11298  }
11299 
11300  /* "View.MemoryView":371
11301  * self.typeinfo = NULL
11302  *
11303  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11304  * if self.obj is not None:
11305  * __Pyx_ReleaseBuffer(&self.view)
11306  */
11307 
11308  /* function exit code */
11309  __Pyx_RefNannyFinishContext();
11310 }
11311 
11312 /* "View.MemoryView":388
11313  * PyThread_free_lock(self.lock)
11314  *
11315  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11316  * cdef Py_ssize_t dim
11317  * cdef char *itemp = <char *> self.view.buf
11318  */
11319 
11320 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11321  Py_ssize_t __pyx_v_dim;
11322  char *__pyx_v_itemp;
11323  PyObject *__pyx_v_idx = NULL;
11324  char *__pyx_r;
11325  __Pyx_RefNannyDeclarations
11326  Py_ssize_t __pyx_t_1;
11327  PyObject *__pyx_t_2 = NULL;
11328  Py_ssize_t __pyx_t_3;
11329  PyObject *(*__pyx_t_4)(PyObject *);
11330  PyObject *__pyx_t_5 = NULL;
11331  Py_ssize_t __pyx_t_6;
11332  char *__pyx_t_7;
11333  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11334 
11335  /* "View.MemoryView":390
11336  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11337  * cdef Py_ssize_t dim
11338  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11339  *
11340  * for dim, idx in enumerate(index):
11341  */
11342  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11343 
11344  /* "View.MemoryView":392
11345  * cdef char *itemp = <char *> self.view.buf
11346  *
11347  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11348  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11349  *
11350  */
11351  __pyx_t_1 = 0;
11352  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11353  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11354  __pyx_t_4 = NULL;
11355  } else {
11356  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error)
11357  __Pyx_GOTREF(__pyx_t_2);
11358  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 392, __pyx_L1_error)
11359  }
11360  for (;;) {
11361  if (likely(!__pyx_t_4)) {
11362  if (likely(PyList_CheckExact(__pyx_t_2))) {
11363  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11364  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11365  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
11366  #else
11367  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
11368  __Pyx_GOTREF(__pyx_t_5);
11369  #endif
11370  } else {
11371  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11372  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11373  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
11374  #else
11375  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
11376  __Pyx_GOTREF(__pyx_t_5);
11377  #endif
11378  }
11379  } else {
11380  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11381  if (unlikely(!__pyx_t_5)) {
11382  PyObject* exc_type = PyErr_Occurred();
11383  if (exc_type) {
11384  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11385  else __PYX_ERR(1, 392, __pyx_L1_error)
11386  }
11387  break;
11388  }
11389  __Pyx_GOTREF(__pyx_t_5);
11390  }
11391  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11392  __pyx_t_5 = 0;
11393  __pyx_v_dim = __pyx_t_1;
11394  __pyx_t_1 = (__pyx_t_1 + 1);
11395 
11396  /* "View.MemoryView":393
11397  *
11398  * for dim, idx in enumerate(index):
11399  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11400  *
11401  * return itemp
11402  */
11403  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 393, __pyx_L1_error)
11404  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 393, __pyx_L1_error)
11405  __pyx_v_itemp = __pyx_t_7;
11406 
11407  /* "View.MemoryView":392
11408  * cdef char *itemp = <char *> self.view.buf
11409  *
11410  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11411  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11412  *
11413  */
11414  }
11415  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11416 
11417  /* "View.MemoryView":395
11418  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11419  *
11420  * return itemp # <<<<<<<<<<<<<<
11421  *
11422  *
11423  */
11424  __pyx_r = __pyx_v_itemp;
11425  goto __pyx_L0;
11426 
11427  /* "View.MemoryView":388
11428  * PyThread_free_lock(self.lock)
11429  *
11430  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11431  * cdef Py_ssize_t dim
11432  * cdef char *itemp = <char *> self.view.buf
11433  */
11434 
11435  /* function exit code */
11436  __pyx_L1_error:;
11437  __Pyx_XDECREF(__pyx_t_2);
11438  __Pyx_XDECREF(__pyx_t_5);
11439  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11440  __pyx_r = NULL;
11441  __pyx_L0:;
11442  __Pyx_XDECREF(__pyx_v_idx);
11443  __Pyx_RefNannyFinishContext();
11444  return __pyx_r;
11445 }
11446 
11447 /* "View.MemoryView":398
11448  *
11449  *
11450  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11451  * if index is Ellipsis:
11452  * return self
11453  */
11454 
11455 /* Python wrapper */
11456 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11457 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11458  PyObject *__pyx_r = 0;
11459  __Pyx_RefNannyDeclarations
11460  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11461  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11462 
11463  /* function exit code */
11464  __Pyx_RefNannyFinishContext();
11465  return __pyx_r;
11466 }
11467 
11468 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11469  PyObject *__pyx_v_have_slices = NULL;
11470  PyObject *__pyx_v_indices = NULL;
11471  char *__pyx_v_itemp;
11472  PyObject *__pyx_r = NULL;
11473  __Pyx_RefNannyDeclarations
11474  int __pyx_t_1;
11475  int __pyx_t_2;
11476  PyObject *__pyx_t_3 = NULL;
11477  PyObject *__pyx_t_4 = NULL;
11478  PyObject *__pyx_t_5 = NULL;
11479  char *__pyx_t_6;
11480  __Pyx_RefNannySetupContext("__getitem__", 0);
11481 
11482  /* "View.MemoryView":399
11483  *
11484  * def __getitem__(memoryview self, object index):
11485  * if index is Ellipsis: # <<<<<<<<<<<<<<
11486  * return self
11487  *
11488  */
11489  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11490  __pyx_t_2 = (__pyx_t_1 != 0);
11491  if (__pyx_t_2) {
11492 
11493  /* "View.MemoryView":400
11494  * def __getitem__(memoryview self, object index):
11495  * if index is Ellipsis:
11496  * return self # <<<<<<<<<<<<<<
11497  *
11498  * have_slices, indices = _unellipsify(index, self.view.ndim)
11499  */
11500  __Pyx_XDECREF(__pyx_r);
11501  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11502  __pyx_r = ((PyObject *)__pyx_v_self);
11503  goto __pyx_L0;
11504 
11505  /* "View.MemoryView":399
11506  *
11507  * def __getitem__(memoryview self, object index):
11508  * if index is Ellipsis: # <<<<<<<<<<<<<<
11509  * return self
11510  *
11511  */
11512  }
11513 
11514  /* "View.MemoryView":402
11515  * return self
11516  *
11517  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11518  *
11519  * cdef char *itemp
11520  */
11521  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 402, __pyx_L1_error)
11522  __Pyx_GOTREF(__pyx_t_3);
11523  if (likely(__pyx_t_3 != Py_None)) {
11524  PyObject* sequence = __pyx_t_3;
11525  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11526  if (unlikely(size != 2)) {
11527  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11528  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11529  __PYX_ERR(1, 402, __pyx_L1_error)
11530  }
11531  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11532  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11533  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11534  __Pyx_INCREF(__pyx_t_4);
11535  __Pyx_INCREF(__pyx_t_5);
11536  #else
11537  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 402, __pyx_L1_error)
11538  __Pyx_GOTREF(__pyx_t_4);
11539  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 402, __pyx_L1_error)
11540  __Pyx_GOTREF(__pyx_t_5);
11541  #endif
11542  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11543  } else {
11544  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 402, __pyx_L1_error)
11545  }
11546  __pyx_v_have_slices = __pyx_t_4;
11547  __pyx_t_4 = 0;
11548  __pyx_v_indices = __pyx_t_5;
11549  __pyx_t_5 = 0;
11550 
11551  /* "View.MemoryView":405
11552  *
11553  * cdef char *itemp
11554  * if have_slices: # <<<<<<<<<<<<<<
11555  * return memview_slice(self, indices)
11556  * else:
11557  */
11558  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 405, __pyx_L1_error)
11559  if (__pyx_t_2) {
11560 
11561  /* "View.MemoryView":406
11562  * cdef char *itemp
11563  * if have_slices:
11564  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11565  * else:
11566  * itemp = self.get_item_pointer(indices)
11567  */
11568  __Pyx_XDECREF(__pyx_r);
11569  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error)
11570  __Pyx_GOTREF(__pyx_t_3);
11571  __pyx_r = __pyx_t_3;
11572  __pyx_t_3 = 0;
11573  goto __pyx_L0;
11574 
11575  /* "View.MemoryView":405
11576  *
11577  * cdef char *itemp
11578  * if have_slices: # <<<<<<<<<<<<<<
11579  * return memview_slice(self, indices)
11580  * else:
11581  */
11582  }
11583 
11584  /* "View.MemoryView":408
11585  * return memview_slice(self, indices)
11586  * else:
11587  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11588  * return self.convert_item_to_object(itemp)
11589  *
11590  */
11591  /*else*/ {
11592  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 408, __pyx_L1_error)
11593  __pyx_v_itemp = __pyx_t_6;
11594 
11595  /* "View.MemoryView":409
11596  * else:
11597  * itemp = self.get_item_pointer(indices)
11598  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11599  *
11600  * def __setitem__(memoryview self, object index, object value):
11601  */
11602  __Pyx_XDECREF(__pyx_r);
11603  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
11604  __Pyx_GOTREF(__pyx_t_3);
11605  __pyx_r = __pyx_t_3;
11606  __pyx_t_3 = 0;
11607  goto __pyx_L0;
11608  }
11609 
11610  /* "View.MemoryView":398
11611  *
11612  *
11613  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11614  * if index is Ellipsis:
11615  * return self
11616  */
11617 
11618  /* function exit code */
11619  __pyx_L1_error:;
11620  __Pyx_XDECREF(__pyx_t_3);
11621  __Pyx_XDECREF(__pyx_t_4);
11622  __Pyx_XDECREF(__pyx_t_5);
11623  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11624  __pyx_r = NULL;
11625  __pyx_L0:;
11626  __Pyx_XDECREF(__pyx_v_have_slices);
11627  __Pyx_XDECREF(__pyx_v_indices);
11628  __Pyx_XGIVEREF(__pyx_r);
11629  __Pyx_RefNannyFinishContext();
11630  return __pyx_r;
11631 }
11632 
11633 /* "View.MemoryView":411
11634  * return self.convert_item_to_object(itemp)
11635  *
11636  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11637  * if self.view.readonly:
11638  * raise TypeError("Cannot assign to read-only memoryview")
11639  */
11640 
11641 /* Python wrapper */
11642 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11643 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11644  int __pyx_r;
11645  __Pyx_RefNannyDeclarations
11646  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11647  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11648 
11649  /* function exit code */
11650  __Pyx_RefNannyFinishContext();
11651  return __pyx_r;
11652 }
11653 
11654 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11655  PyObject *__pyx_v_have_slices = NULL;
11656  PyObject *__pyx_v_obj = NULL;
11657  int __pyx_r;
11658  __Pyx_RefNannyDeclarations
11659  int __pyx_t_1;
11660  PyObject *__pyx_t_2 = NULL;
11661  PyObject *__pyx_t_3 = NULL;
11662  PyObject *__pyx_t_4 = NULL;
11663  __Pyx_RefNannySetupContext("__setitem__", 0);
11664  __Pyx_INCREF(__pyx_v_index);
11665 
11666  /* "View.MemoryView":412
11667  *
11668  * def __setitem__(memoryview self, object index, object value):
11669  * if self.view.readonly: # <<<<<<<<<<<<<<
11670  * raise TypeError("Cannot assign to read-only memoryview")
11671  *
11672  */
11673  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11674  if (unlikely(__pyx_t_1)) {
11675 
11676  /* "View.MemoryView":413
11677  * def __setitem__(memoryview self, object index, object value):
11678  * if self.view.readonly:
11679  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11680  *
11681  * have_slices, index = _unellipsify(index, self.view.ndim)
11682  */
11683  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
11684  __Pyx_GOTREF(__pyx_t_2);
11685  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11686  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11687  __PYX_ERR(1, 413, __pyx_L1_error)
11688 
11689  /* "View.MemoryView":412
11690  *
11691  * def __setitem__(memoryview self, object index, object value):
11692  * if self.view.readonly: # <<<<<<<<<<<<<<
11693  * raise TypeError("Cannot assign to read-only memoryview")
11694  *
11695  */
11696  }
11697 
11698  /* "View.MemoryView":415
11699  * raise TypeError("Cannot assign to read-only memoryview")
11700  *
11701  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11702  *
11703  * if have_slices:
11704  */
11705  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
11706  __Pyx_GOTREF(__pyx_t_2);
11707  if (likely(__pyx_t_2 != Py_None)) {
11708  PyObject* sequence = __pyx_t_2;
11709  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11710  if (unlikely(size != 2)) {
11711  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11712  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11713  __PYX_ERR(1, 415, __pyx_L1_error)
11714  }
11715  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11716  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11717  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11718  __Pyx_INCREF(__pyx_t_3);
11719  __Pyx_INCREF(__pyx_t_4);
11720  #else
11721  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 415, __pyx_L1_error)
11722  __Pyx_GOTREF(__pyx_t_3);
11723  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 415, __pyx_L1_error)
11724  __Pyx_GOTREF(__pyx_t_4);
11725  #endif
11726  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11727  } else {
11728  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 415, __pyx_L1_error)
11729  }
11730  __pyx_v_have_slices = __pyx_t_3;
11731  __pyx_t_3 = 0;
11732  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11733  __pyx_t_4 = 0;
11734 
11735  /* "View.MemoryView":417
11736  * have_slices, index = _unellipsify(index, self.view.ndim)
11737  *
11738  * if have_slices: # <<<<<<<<<<<<<<
11739  * obj = self.is_slice(value)
11740  * if obj:
11741  */
11742  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 417, __pyx_L1_error)
11743  if (__pyx_t_1) {
11744 
11745  /* "View.MemoryView":418
11746  *
11747  * if have_slices:
11748  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11749  * if obj:
11750  * self.setitem_slice_assignment(self[index], obj)
11751  */
11752  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11753  __Pyx_GOTREF(__pyx_t_2);
11754  __pyx_v_obj = __pyx_t_2;
11755  __pyx_t_2 = 0;
11756 
11757  /* "View.MemoryView":419
11758  * if have_slices:
11759  * obj = self.is_slice(value)
11760  * if obj: # <<<<<<<<<<<<<<
11761  * self.setitem_slice_assignment(self[index], obj)
11762  * else:
11763  */
11764  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 419, __pyx_L1_error)
11765  if (__pyx_t_1) {
11766 
11767  /* "View.MemoryView":420
11768  * obj = self.is_slice(value)
11769  * if obj:
11770  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11771  * else:
11772  * self.setitem_slice_assign_scalar(self[index], value)
11773  */
11774  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11775  __Pyx_GOTREF(__pyx_t_2);
11776  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11777  __Pyx_GOTREF(__pyx_t_4);
11778  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11779  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11780 
11781  /* "View.MemoryView":419
11782  * if have_slices:
11783  * obj = self.is_slice(value)
11784  * if obj: # <<<<<<<<<<<<<<
11785  * self.setitem_slice_assignment(self[index], obj)
11786  * else:
11787  */
11788  goto __pyx_L5;
11789  }
11790 
11791  /* "View.MemoryView":422
11792  * self.setitem_slice_assignment(self[index], obj)
11793  * else:
11794  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11795  * else:
11796  * self.setitem_indexed(index, value)
11797  */
11798  /*else*/ {
11799  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
11800  __Pyx_GOTREF(__pyx_t_4);
11801  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 422, __pyx_L1_error)
11802  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
11803  __Pyx_GOTREF(__pyx_t_2);
11804  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11805  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11806  }
11807  __pyx_L5:;
11808 
11809  /* "View.MemoryView":417
11810  * have_slices, index = _unellipsify(index, self.view.ndim)
11811  *
11812  * if have_slices: # <<<<<<<<<<<<<<
11813  * obj = self.is_slice(value)
11814  * if obj:
11815  */
11816  goto __pyx_L4;
11817  }
11818 
11819  /* "View.MemoryView":424
11820  * self.setitem_slice_assign_scalar(self[index], value)
11821  * else:
11822  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11823  *
11824  * cdef is_slice(self, obj):
11825  */
11826  /*else*/ {
11827  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
11828  __Pyx_GOTREF(__pyx_t_2);
11829  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11830  }
11831  __pyx_L4:;
11832 
11833  /* "View.MemoryView":411
11834  * return self.convert_item_to_object(itemp)
11835  *
11836  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11837  * if self.view.readonly:
11838  * raise TypeError("Cannot assign to read-only memoryview")
11839  */
11840 
11841  /* function exit code */
11842  __pyx_r = 0;
11843  goto __pyx_L0;
11844  __pyx_L1_error:;
11845  __Pyx_XDECREF(__pyx_t_2);
11846  __Pyx_XDECREF(__pyx_t_3);
11847  __Pyx_XDECREF(__pyx_t_4);
11848  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11849  __pyx_r = -1;
11850  __pyx_L0:;
11851  __Pyx_XDECREF(__pyx_v_have_slices);
11852  __Pyx_XDECREF(__pyx_v_obj);
11853  __Pyx_XDECREF(__pyx_v_index);
11854  __Pyx_RefNannyFinishContext();
11855  return __pyx_r;
11856 }
11857 
11858 /* "View.MemoryView":426
11859  * self.setitem_indexed(index, value)
11860  *
11861  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11862  * if not isinstance(obj, memoryview):
11863  * try:
11864  */
11865 
11866 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11867  PyObject *__pyx_r = NULL;
11868  __Pyx_RefNannyDeclarations
11869  int __pyx_t_1;
11870  int __pyx_t_2;
11871  PyObject *__pyx_t_3 = NULL;
11872  PyObject *__pyx_t_4 = NULL;
11873  PyObject *__pyx_t_5 = NULL;
11874  PyObject *__pyx_t_6 = NULL;
11875  PyObject *__pyx_t_7 = NULL;
11876  PyObject *__pyx_t_8 = NULL;
11877  int __pyx_t_9;
11878  __Pyx_RefNannySetupContext("is_slice", 0);
11879  __Pyx_INCREF(__pyx_v_obj);
11880 
11881  /* "View.MemoryView":427
11882  *
11883  * cdef is_slice(self, obj):
11884  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11885  * try:
11886  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11887  */
11888  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11889  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11890  if (__pyx_t_2) {
11891 
11892  /* "View.MemoryView":428
11893  * cdef is_slice(self, obj):
11894  * if not isinstance(obj, memoryview):
11895  * try: # <<<<<<<<<<<<<<
11896  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11897  * self.dtype_is_object)
11898  */
11899  {
11900  __Pyx_PyThreadState_declare
11901  __Pyx_PyThreadState_assign
11902  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11903  __Pyx_XGOTREF(__pyx_t_3);
11904  __Pyx_XGOTREF(__pyx_t_4);
11905  __Pyx_XGOTREF(__pyx_t_5);
11906  /*try:*/ {
11907 
11908  /* "View.MemoryView":429
11909  * if not isinstance(obj, memoryview):
11910  * try:
11911  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11912  * self.dtype_is_object)
11913  * except TypeError:
11914  */
11915  __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 429, __pyx_L4_error)
11916  __Pyx_GOTREF(__pyx_t_6);
11917 
11918  /* "View.MemoryView":430
11919  * try:
11920  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11921  * self.dtype_is_object) # <<<<<<<<<<<<<<
11922  * except TypeError:
11923  * return None
11924  */
11925  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
11926  __Pyx_GOTREF(__pyx_t_7);
11927 
11928  /* "View.MemoryView":429
11929  * if not isinstance(obj, memoryview):
11930  * try:
11931  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11932  * self.dtype_is_object)
11933  * except TypeError:
11934  */
11935  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 429, __pyx_L4_error)
11936  __Pyx_GOTREF(__pyx_t_8);
11937  __Pyx_INCREF(__pyx_v_obj);
11938  __Pyx_GIVEREF(__pyx_v_obj);
11939  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11940  __Pyx_GIVEREF(__pyx_t_6);
11941  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11942  __Pyx_GIVEREF(__pyx_t_7);
11943  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11944  __pyx_t_6 = 0;
11945  __pyx_t_7 = 0;
11946  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 429, __pyx_L4_error)
11947  __Pyx_GOTREF(__pyx_t_7);
11948  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11949  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11950  __pyx_t_7 = 0;
11951 
11952  /* "View.MemoryView":428
11953  * cdef is_slice(self, obj):
11954  * if not isinstance(obj, memoryview):
11955  * try: # <<<<<<<<<<<<<<
11956  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11957  * self.dtype_is_object)
11958  */
11959  }
11960  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11961  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11962  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11963  goto __pyx_L9_try_end;
11964  __pyx_L4_error:;
11965  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11966  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11967  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11968 
11969  /* "View.MemoryView":431
11970  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11971  * self.dtype_is_object)
11972  * except TypeError: # <<<<<<<<<<<<<<
11973  * return None
11974  *
11975  */
11976  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11977  if (__pyx_t_9) {
11978  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11979  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 431, __pyx_L6_except_error)
11980  __Pyx_GOTREF(__pyx_t_7);
11981  __Pyx_GOTREF(__pyx_t_8);
11982  __Pyx_GOTREF(__pyx_t_6);
11983 
11984  /* "View.MemoryView":432
11985  * self.dtype_is_object)
11986  * except TypeError:
11987  * return None # <<<<<<<<<<<<<<
11988  *
11989  * return obj
11990  */
11991  __Pyx_XDECREF(__pyx_r);
11992  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11993  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11994  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11995  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11996  goto __pyx_L7_except_return;
11997  }
11998  goto __pyx_L6_except_error;
11999  __pyx_L6_except_error:;
12000 
12001  /* "View.MemoryView":428
12002  * cdef is_slice(self, obj):
12003  * if not isinstance(obj, memoryview):
12004  * try: # <<<<<<<<<<<<<<
12005  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
12006  * self.dtype_is_object)
12007  */
12008  __Pyx_XGIVEREF(__pyx_t_3);
12009  __Pyx_XGIVEREF(__pyx_t_4);
12010  __Pyx_XGIVEREF(__pyx_t_5);
12011  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12012  goto __pyx_L1_error;
12013  __pyx_L7_except_return:;
12014  __Pyx_XGIVEREF(__pyx_t_3);
12015  __Pyx_XGIVEREF(__pyx_t_4);
12016  __Pyx_XGIVEREF(__pyx_t_5);
12017  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12018  goto __pyx_L0;
12019  __pyx_L9_try_end:;
12020  }
12021 
12022  /* "View.MemoryView":427
12023  *
12024  * cdef is_slice(self, obj):
12025  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12026  * try:
12027  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
12028  */
12029  }
12030 
12031  /* "View.MemoryView":434
12032  * return None
12033  *
12034  * return obj # <<<<<<<<<<<<<<
12035  *
12036  * cdef setitem_slice_assignment(self, dst, src):
12037  */
12038  __Pyx_XDECREF(__pyx_r);
12039  __Pyx_INCREF(__pyx_v_obj);
12040  __pyx_r = __pyx_v_obj;
12041  goto __pyx_L0;
12042 
12043  /* "View.MemoryView":426
12044  * self.setitem_indexed(index, value)
12045  *
12046  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12047  * if not isinstance(obj, memoryview):
12048  * try:
12049  */
12050 
12051  /* function exit code */
12052  __pyx_L1_error:;
12053  __Pyx_XDECREF(__pyx_t_6);
12054  __Pyx_XDECREF(__pyx_t_7);
12055  __Pyx_XDECREF(__pyx_t_8);
12056  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12057  __pyx_r = 0;
12058  __pyx_L0:;
12059  __Pyx_XDECREF(__pyx_v_obj);
12060  __Pyx_XGIVEREF(__pyx_r);
12061  __Pyx_RefNannyFinishContext();
12062  return __pyx_r;
12063 }
12064 
12065 /* "View.MemoryView":436
12066  * return obj
12067  *
12068  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12069  * cdef __Pyx_memviewslice dst_slice
12070  * cdef __Pyx_memviewslice src_slice
12071  */
12072 
12073 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12074  __Pyx_memviewslice __pyx_v_dst_slice;
12075  __Pyx_memviewslice __pyx_v_src_slice;
12076  PyObject *__pyx_r = NULL;
12077  __Pyx_RefNannyDeclarations
12078  PyObject *__pyx_t_1 = NULL;
12079  int __pyx_t_2;
12080  int __pyx_t_3;
12081  int __pyx_t_4;
12082  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12083 
12084  /* "View.MemoryView":440
12085  * cdef __Pyx_memviewslice src_slice
12086  *
12087  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12088  * get_slice_from_memview(dst, &dst_slice)[0],
12089  * src.ndim, dst.ndim, self.dtype_is_object)
12090  */
12091  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 440, __pyx_L1_error)
12092 
12093  /* "View.MemoryView":441
12094  *
12095  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12096  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12097  * src.ndim, dst.ndim, self.dtype_is_object)
12098  *
12099  */
12100  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
12101 
12102  /* "View.MemoryView":442
12103  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12104  * get_slice_from_memview(dst, &dst_slice)[0],
12105  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12106  *
12107  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12108  */
12109  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
12110  __Pyx_GOTREF(__pyx_t_1);
12111  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
12112  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12113  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
12114  __Pyx_GOTREF(__pyx_t_1);
12115  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
12116  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12117 
12118  /* "View.MemoryView":440
12119  * cdef __Pyx_memviewslice src_slice
12120  *
12121  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12122  * get_slice_from_memview(dst, &dst_slice)[0],
12123  * src.ndim, dst.ndim, self.dtype_is_object)
12124  */
12125  __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 440, __pyx_L1_error)
12126 
12127  /* "View.MemoryView":436
12128  * return obj
12129  *
12130  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12131  * cdef __Pyx_memviewslice dst_slice
12132  * cdef __Pyx_memviewslice src_slice
12133  */
12134 
12135  /* function exit code */
12136  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12137  goto __pyx_L0;
12138  __pyx_L1_error:;
12139  __Pyx_XDECREF(__pyx_t_1);
12140  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12141  __pyx_r = 0;
12142  __pyx_L0:;
12143  __Pyx_XGIVEREF(__pyx_r);
12144  __Pyx_RefNannyFinishContext();
12145  return __pyx_r;
12146 }
12147 
12148 /* "View.MemoryView":444
12149  * src.ndim, dst.ndim, self.dtype_is_object)
12150  *
12151  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12152  * cdef int array[128]
12153  * cdef void *tmp = NULL
12154  */
12155 
12156 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12157  int __pyx_v_array[0x80];
12158  void *__pyx_v_tmp;
12159  void *__pyx_v_item;
12160  __Pyx_memviewslice *__pyx_v_dst_slice;
12161  __Pyx_memviewslice __pyx_v_tmp_slice;
12162  PyObject *__pyx_r = NULL;
12163  __Pyx_RefNannyDeclarations
12164  int __pyx_t_1;
12165  PyObject *__pyx_t_2 = NULL;
12166  int __pyx_t_3;
12167  int __pyx_t_4;
12168  char const *__pyx_t_5;
12169  PyObject *__pyx_t_6 = NULL;
12170  PyObject *__pyx_t_7 = NULL;
12171  PyObject *__pyx_t_8 = NULL;
12172  PyObject *__pyx_t_9 = NULL;
12173  PyObject *__pyx_t_10 = NULL;
12174  PyObject *__pyx_t_11 = NULL;
12175  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12176 
12177  /* "View.MemoryView":446
12178  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12179  * cdef int array[128]
12180  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12181  * cdef void *item
12182  *
12183  */
12184  __pyx_v_tmp = NULL;
12185 
12186  /* "View.MemoryView":451
12187  * cdef __Pyx_memviewslice *dst_slice
12188  * cdef __Pyx_memviewslice tmp_slice
12189  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12190  *
12191  * if <size_t>self.view.itemsize > sizeof(array):
12192  */
12193  __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
12194 
12195  /* "View.MemoryView":453
12196  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12197  *
12198  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12199  * tmp = PyMem_Malloc(self.view.itemsize)
12200  * if tmp == NULL:
12201  */
12202  __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12203  if (__pyx_t_1) {
12204 
12205  /* "View.MemoryView":454
12206  *
12207  * if <size_t>self.view.itemsize > sizeof(array):
12208  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12209  * if tmp == NULL:
12210  * raise MemoryError
12211  */
12212  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12213 
12214  /* "View.MemoryView":455
12215  * if <size_t>self.view.itemsize > sizeof(array):
12216  * tmp = PyMem_Malloc(self.view.itemsize)
12217  * if tmp == NULL: # <<<<<<<<<<<<<<
12218  * raise MemoryError
12219  * item = tmp
12220  */
12221  __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
12222  if (unlikely(__pyx_t_1)) {
12223 
12224  /* "View.MemoryView":456
12225  * tmp = PyMem_Malloc(self.view.itemsize)
12226  * if tmp == NULL:
12227  * raise MemoryError # <<<<<<<<<<<<<<
12228  * item = tmp
12229  * else:
12230  */
12231  PyErr_NoMemory(); __PYX_ERR(1, 456, __pyx_L1_error)
12232 
12233  /* "View.MemoryView":455
12234  * if <size_t>self.view.itemsize > sizeof(array):
12235  * tmp = PyMem_Malloc(self.view.itemsize)
12236  * if tmp == NULL: # <<<<<<<<<<<<<<
12237  * raise MemoryError
12238  * item = tmp
12239  */
12240  }
12241 
12242  /* "View.MemoryView":457
12243  * if tmp == NULL:
12244  * raise MemoryError
12245  * item = tmp # <<<<<<<<<<<<<<
12246  * else:
12247  * item = <void *> array
12248  */
12249  __pyx_v_item = __pyx_v_tmp;
12250 
12251  /* "View.MemoryView":453
12252  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12253  *
12254  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12255  * tmp = PyMem_Malloc(self.view.itemsize)
12256  * if tmp == NULL:
12257  */
12258  goto __pyx_L3;
12259  }
12260 
12261  /* "View.MemoryView":459
12262  * item = tmp
12263  * else:
12264  * item = <void *> array # <<<<<<<<<<<<<<
12265  *
12266  * try:
12267  */
12268  /*else*/ {
12269  __pyx_v_item = ((void *)__pyx_v_array);
12270  }
12271  __pyx_L3:;
12272 
12273  /* "View.MemoryView":461
12274  * item = <void *> array
12275  *
12276  * try: # <<<<<<<<<<<<<<
12277  * if self.dtype_is_object:
12278  * (<PyObject **> item)[0] = <PyObject *> value
12279  */
12280  /*try:*/ {
12281 
12282  /* "View.MemoryView":462
12283  *
12284  * try:
12285  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12286  * (<PyObject **> item)[0] = <PyObject *> value
12287  * else:
12288  */
12289  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12290  if (__pyx_t_1) {
12291 
12292  /* "View.MemoryView":463
12293  * try:
12294  * if self.dtype_is_object:
12295  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12296  * else:
12297  * self.assign_item_from_object(<char *> item, value)
12298  */
12299  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12300 
12301  /* "View.MemoryView":462
12302  *
12303  * try:
12304  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12305  * (<PyObject **> item)[0] = <PyObject *> value
12306  * else:
12307  */
12308  goto __pyx_L8;
12309  }
12310 
12311  /* "View.MemoryView":465
12312  * (<PyObject **> item)[0] = <PyObject *> value
12313  * else:
12314  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12315  *
12316  *
12317  */
12318  /*else*/ {
12319  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 465, __pyx_L6_error)
12320  __Pyx_GOTREF(__pyx_t_2);
12321  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12322  }
12323  __pyx_L8:;
12324 
12325  /* "View.MemoryView":469
12326  *
12327  *
12328  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12329  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12330  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12331  */
12332  __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12333  if (__pyx_t_1) {
12334 
12335  /* "View.MemoryView":470
12336  *
12337  * if self.view.suboffsets != NULL:
12338  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12339  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12340  * item, self.dtype_is_object)
12341  */
12342  __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 470, __pyx_L6_error)
12343  __Pyx_GOTREF(__pyx_t_2);
12344  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12345 
12346  /* "View.MemoryView":469
12347  *
12348  *
12349  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12350  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12351  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12352  */
12353  }
12354 
12355  /* "View.MemoryView":471
12356  * if self.view.suboffsets != NULL:
12357  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12358  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12359  * item, self.dtype_is_object)
12360  * finally:
12361  */
12362  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12363  }
12364 
12365  /* "View.MemoryView":474
12366  * item, self.dtype_is_object)
12367  * finally:
12368  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12369  *
12370  * cdef setitem_indexed(self, index, value):
12371  */
12372  /*finally:*/ {
12373  /*normal exit:*/{
12374  PyMem_Free(__pyx_v_tmp);
12375  goto __pyx_L7;
12376  }
12377  __pyx_L6_error:;
12378  /*exception exit:*/{
12379  __Pyx_PyThreadState_declare
12380  __Pyx_PyThreadState_assign
12381  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12382  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12383  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
12384  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
12385  __Pyx_XGOTREF(__pyx_t_6);
12386  __Pyx_XGOTREF(__pyx_t_7);
12387  __Pyx_XGOTREF(__pyx_t_8);
12388  __Pyx_XGOTREF(__pyx_t_9);
12389  __Pyx_XGOTREF(__pyx_t_10);
12390  __Pyx_XGOTREF(__pyx_t_11);
12391  __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
12392  {
12393  PyMem_Free(__pyx_v_tmp);
12394  }
12395  if (PY_MAJOR_VERSION >= 3) {
12396  __Pyx_XGIVEREF(__pyx_t_9);
12397  __Pyx_XGIVEREF(__pyx_t_10);
12398  __Pyx_XGIVEREF(__pyx_t_11);
12399  __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
12400  }
12401  __Pyx_XGIVEREF(__pyx_t_6);
12402  __Pyx_XGIVEREF(__pyx_t_7);
12403  __Pyx_XGIVEREF(__pyx_t_8);
12404  __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
12405  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12406  __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
12407  goto __pyx_L1_error;
12408  }
12409  __pyx_L7:;
12410  }
12411 
12412  /* "View.MemoryView":444
12413  * src.ndim, dst.ndim, self.dtype_is_object)
12414  *
12415  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12416  * cdef int array[128]
12417  * cdef void *tmp = NULL
12418  */
12419 
12420  /* function exit code */
12421  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12422  goto __pyx_L0;
12423  __pyx_L1_error:;
12424  __Pyx_XDECREF(__pyx_t_2);
12425  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12426  __pyx_r = 0;
12427  __pyx_L0:;
12428  __Pyx_XGIVEREF(__pyx_r);
12429  __Pyx_RefNannyFinishContext();
12430  return __pyx_r;
12431 }
12432 
12433 /* "View.MemoryView":476
12434  * PyMem_Free(tmp)
12435  *
12436  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12437  * cdef char *itemp = self.get_item_pointer(index)
12438  * self.assign_item_from_object(itemp, value)
12439  */
12440 
12441 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12442  char *__pyx_v_itemp;
12443  PyObject *__pyx_r = NULL;
12444  __Pyx_RefNannyDeclarations
12445  char *__pyx_t_1;
12446  PyObject *__pyx_t_2 = NULL;
12447  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12448 
12449  /* "View.MemoryView":477
12450  *
12451  * cdef setitem_indexed(self, index, value):
12452  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12453  * self.assign_item_from_object(itemp, value)
12454  *
12455  */
12456  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 477, __pyx_L1_error)
12457  __pyx_v_itemp = __pyx_t_1;
12458 
12459  /* "View.MemoryView":478
12460  * cdef setitem_indexed(self, index, value):
12461  * cdef char *itemp = self.get_item_pointer(index)
12462  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12463  *
12464  * cdef convert_item_to_object(self, char *itemp):
12465  */
12466  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 478, __pyx_L1_error)
12467  __Pyx_GOTREF(__pyx_t_2);
12468  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12469 
12470  /* "View.MemoryView":476
12471  * PyMem_Free(tmp)
12472  *
12473  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12474  * cdef char *itemp = self.get_item_pointer(index)
12475  * self.assign_item_from_object(itemp, value)
12476  */
12477 
12478  /* function exit code */
12479  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12480  goto __pyx_L0;
12481  __pyx_L1_error:;
12482  __Pyx_XDECREF(__pyx_t_2);
12483  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12484  __pyx_r = 0;
12485  __pyx_L0:;
12486  __Pyx_XGIVEREF(__pyx_r);
12487  __Pyx_RefNannyFinishContext();
12488  return __pyx_r;
12489 }
12490 
12491 /* "View.MemoryView":480
12492  * self.assign_item_from_object(itemp, value)
12493  *
12494  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12495  * """Only used if instantiated manually by the user, or if Cython doesn't
12496  * know how to convert the type"""
12497  */
12498 
12499 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12500  PyObject *__pyx_v_struct = NULL;
12501  PyObject *__pyx_v_bytesitem = 0;
12502  PyObject *__pyx_v_result = NULL;
12503  PyObject *__pyx_r = NULL;
12504  __Pyx_RefNannyDeclarations
12505  PyObject *__pyx_t_1 = NULL;
12506  PyObject *__pyx_t_2 = NULL;
12507  PyObject *__pyx_t_3 = NULL;
12508  PyObject *__pyx_t_4 = NULL;
12509  PyObject *__pyx_t_5 = NULL;
12510  PyObject *__pyx_t_6 = NULL;
12511  PyObject *__pyx_t_7 = NULL;
12512  int __pyx_t_8;
12513  PyObject *__pyx_t_9 = NULL;
12514  size_t __pyx_t_10;
12515  int __pyx_t_11;
12516  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12517 
12518  /* "View.MemoryView":483
12519  * """Only used if instantiated manually by the user, or if Cython doesn't
12520  * know how to convert the type"""
12521  * import struct # <<<<<<<<<<<<<<
12522  * cdef bytes bytesitem
12523  *
12524  */
12525  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
12526  __Pyx_GOTREF(__pyx_t_1);
12527  __pyx_v_struct = __pyx_t_1;
12528  __pyx_t_1 = 0;
12529 
12530  /* "View.MemoryView":486
12531  * cdef bytes bytesitem
12532  *
12533  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12534  * try:
12535  * result = struct.unpack(self.view.format, bytesitem)
12536  */
12537  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 486, __pyx_L1_error)
12538  __Pyx_GOTREF(__pyx_t_1);
12539  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12540  __pyx_t_1 = 0;
12541 
12542  /* "View.MemoryView":487
12543  *
12544  * bytesitem = itemp[:self.view.itemsize]
12545  * try: # <<<<<<<<<<<<<<
12546  * result = struct.unpack(self.view.format, bytesitem)
12547  * except struct.error:
12548  */
12549  {
12550  __Pyx_PyThreadState_declare
12551  __Pyx_PyThreadState_assign
12552  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12553  __Pyx_XGOTREF(__pyx_t_2);
12554  __Pyx_XGOTREF(__pyx_t_3);
12555  __Pyx_XGOTREF(__pyx_t_4);
12556  /*try:*/ {
12557 
12558  /* "View.MemoryView":488
12559  * bytesitem = itemp[:self.view.itemsize]
12560  * try:
12561  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12562  * except struct.error:
12563  * raise ValueError("Unable to convert item to object")
12564  */
12565  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 488, __pyx_L3_error)
12566  __Pyx_GOTREF(__pyx_t_5);
12567  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 488, __pyx_L3_error)
12568  __Pyx_GOTREF(__pyx_t_6);
12569  __pyx_t_7 = NULL;
12570  __pyx_t_8 = 0;
12571  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12572  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12573  if (likely(__pyx_t_7)) {
12574  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12575  __Pyx_INCREF(__pyx_t_7);
12576  __Pyx_INCREF(function);
12577  __Pyx_DECREF_SET(__pyx_t_5, function);
12578  __pyx_t_8 = 1;
12579  }
12580  }
12581  #if CYTHON_FAST_PYCALL
12582  if (PyFunction_Check(__pyx_t_5)) {
12583  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12584  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12585  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12586  __Pyx_GOTREF(__pyx_t_1);
12587  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12588  } else
12589  #endif
12590  #if CYTHON_FAST_PYCCALL
12591  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12592  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12593  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12594  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12595  __Pyx_GOTREF(__pyx_t_1);
12596  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12597  } else
12598  #endif
12599  {
12600  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 488, __pyx_L3_error)
12601  __Pyx_GOTREF(__pyx_t_9);
12602  if (__pyx_t_7) {
12603  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12604  }
12605  __Pyx_GIVEREF(__pyx_t_6);
12606  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12607  __Pyx_INCREF(__pyx_v_bytesitem);
12608  __Pyx_GIVEREF(__pyx_v_bytesitem);
12609  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12610  __pyx_t_6 = 0;
12611  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12612  __Pyx_GOTREF(__pyx_t_1);
12613  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12614  }
12615  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12616  __pyx_v_result = __pyx_t_1;
12617  __pyx_t_1 = 0;
12618 
12619  /* "View.MemoryView":487
12620  *
12621  * bytesitem = itemp[:self.view.itemsize]
12622  * try: # <<<<<<<<<<<<<<
12623  * result = struct.unpack(self.view.format, bytesitem)
12624  * except struct.error:
12625  */
12626  }
12627 
12628  /* "View.MemoryView":492
12629  * raise ValueError("Unable to convert item to object")
12630  * else:
12631  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12632  * return result[0]
12633  * return result
12634  */
12635  /*else:*/ {
12636  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12637  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12638  if (__pyx_t_11) {
12639 
12640  /* "View.MemoryView":493
12641  * else:
12642  * if len(self.view.format) == 1:
12643  * return result[0] # <<<<<<<<<<<<<<
12644  * return result
12645  *
12646  */
12647  __Pyx_XDECREF(__pyx_r);
12648  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L5_except_error)
12649  __Pyx_GOTREF(__pyx_t_1);
12650  __pyx_r = __pyx_t_1;
12651  __pyx_t_1 = 0;
12652  goto __pyx_L6_except_return;
12653 
12654  /* "View.MemoryView":492
12655  * raise ValueError("Unable to convert item to object")
12656  * else:
12657  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12658  * return result[0]
12659  * return result
12660  */
12661  }
12662 
12663  /* "View.MemoryView":494
12664  * if len(self.view.format) == 1:
12665  * return result[0]
12666  * return result # <<<<<<<<<<<<<<
12667  *
12668  * cdef assign_item_from_object(self, char *itemp, object value):
12669  */
12670  __Pyx_XDECREF(__pyx_r);
12671  __Pyx_INCREF(__pyx_v_result);
12672  __pyx_r = __pyx_v_result;
12673  goto __pyx_L6_except_return;
12674  }
12675  __pyx_L3_error:;
12676  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12677  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12678  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12679  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12680  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12681 
12682  /* "View.MemoryView":489
12683  * try:
12684  * result = struct.unpack(self.view.format, bytesitem)
12685  * except struct.error: # <<<<<<<<<<<<<<
12686  * raise ValueError("Unable to convert item to object")
12687  * else:
12688  */
12689  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12690  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L5_except_error)
12691  __Pyx_GOTREF(__pyx_t_6);
12692  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12693  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12694  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12695  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12696  if (__pyx_t_8) {
12697  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12698  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 489, __pyx_L5_except_error)
12699  __Pyx_GOTREF(__pyx_t_9);
12700  __Pyx_GOTREF(__pyx_t_5);
12701  __Pyx_GOTREF(__pyx_t_1);
12702 
12703  /* "View.MemoryView":490
12704  * result = struct.unpack(self.view.format, bytesitem)
12705  * except struct.error:
12706  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12707  * else:
12708  * if len(self.view.format) == 1:
12709  */
12710  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
12711  __Pyx_GOTREF(__pyx_t_6);
12712  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12713  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12714  __PYX_ERR(1, 490, __pyx_L5_except_error)
12715  }
12716  goto __pyx_L5_except_error;
12717  __pyx_L5_except_error:;
12718 
12719  /* "View.MemoryView":487
12720  *
12721  * bytesitem = itemp[:self.view.itemsize]
12722  * try: # <<<<<<<<<<<<<<
12723  * result = struct.unpack(self.view.format, bytesitem)
12724  * except struct.error:
12725  */
12726  __Pyx_XGIVEREF(__pyx_t_2);
12727  __Pyx_XGIVEREF(__pyx_t_3);
12728  __Pyx_XGIVEREF(__pyx_t_4);
12729  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12730  goto __pyx_L1_error;
12731  __pyx_L6_except_return:;
12732  __Pyx_XGIVEREF(__pyx_t_2);
12733  __Pyx_XGIVEREF(__pyx_t_3);
12734  __Pyx_XGIVEREF(__pyx_t_4);
12735  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12736  goto __pyx_L0;
12737  }
12738 
12739  /* "View.MemoryView":480
12740  * self.assign_item_from_object(itemp, value)
12741  *
12742  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12743  * """Only used if instantiated manually by the user, or if Cython doesn't
12744  * know how to convert the type"""
12745  */
12746 
12747  /* function exit code */
12748  __pyx_L1_error:;
12749  __Pyx_XDECREF(__pyx_t_1);
12750  __Pyx_XDECREF(__pyx_t_5);
12751  __Pyx_XDECREF(__pyx_t_6);
12752  __Pyx_XDECREF(__pyx_t_7);
12753  __Pyx_XDECREF(__pyx_t_9);
12754  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12755  __pyx_r = 0;
12756  __pyx_L0:;
12757  __Pyx_XDECREF(__pyx_v_struct);
12758  __Pyx_XDECREF(__pyx_v_bytesitem);
12759  __Pyx_XDECREF(__pyx_v_result);
12760  __Pyx_XGIVEREF(__pyx_r);
12761  __Pyx_RefNannyFinishContext();
12762  return __pyx_r;
12763 }
12764 
12765 /* "View.MemoryView":496
12766  * return result
12767  *
12768  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12769  * """Only used if instantiated manually by the user, or if Cython doesn't
12770  * know how to convert the type"""
12771  */
12772 
12773 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12774  PyObject *__pyx_v_struct = NULL;
12775  char __pyx_v_c;
12776  PyObject *__pyx_v_bytesvalue = 0;
12777  Py_ssize_t __pyx_v_i;
12778  PyObject *__pyx_r = NULL;
12779  __Pyx_RefNannyDeclarations
12780  PyObject *__pyx_t_1 = NULL;
12781  int __pyx_t_2;
12782  int __pyx_t_3;
12783  PyObject *__pyx_t_4 = NULL;
12784  PyObject *__pyx_t_5 = NULL;
12785  PyObject *__pyx_t_6 = NULL;
12786  int __pyx_t_7;
12787  PyObject *__pyx_t_8 = NULL;
12788  Py_ssize_t __pyx_t_9;
12789  PyObject *__pyx_t_10 = NULL;
12790  char *__pyx_t_11;
12791  char *__pyx_t_12;
12792  char *__pyx_t_13;
12793  char *__pyx_t_14;
12794  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12795 
12796  /* "View.MemoryView":499
12797  * """Only used if instantiated manually by the user, or if Cython doesn't
12798  * know how to convert the type"""
12799  * import struct # <<<<<<<<<<<<<<
12800  * cdef char c
12801  * cdef bytes bytesvalue
12802  */
12803  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error)
12804  __Pyx_GOTREF(__pyx_t_1);
12805  __pyx_v_struct = __pyx_t_1;
12806  __pyx_t_1 = 0;
12807 
12808  /* "View.MemoryView":504
12809  * cdef Py_ssize_t i
12810  *
12811  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12812  * bytesvalue = struct.pack(self.view.format, *value)
12813  * else:
12814  */
12815  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12816  __pyx_t_3 = (__pyx_t_2 != 0);
12817  if (__pyx_t_3) {
12818 
12819  /* "View.MemoryView":505
12820  *
12821  * if isinstance(value, tuple):
12822  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12823  * else:
12824  * bytesvalue = struct.pack(self.view.format, value)
12825  */
12826  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 505, __pyx_L1_error)
12827  __Pyx_GOTREF(__pyx_t_1);
12828  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12829  __Pyx_GOTREF(__pyx_t_4);
12830  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 505, __pyx_L1_error)
12831  __Pyx_GOTREF(__pyx_t_5);
12832  __Pyx_GIVEREF(__pyx_t_4);
12833  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12834  __pyx_t_4 = 0;
12835  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12836  __Pyx_GOTREF(__pyx_t_4);
12837  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 505, __pyx_L1_error)
12838  __Pyx_GOTREF(__pyx_t_6);
12839  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12840  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12841  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12842  __Pyx_GOTREF(__pyx_t_4);
12843  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12844  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12845  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 505, __pyx_L1_error)
12846  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12847  __pyx_t_4 = 0;
12848 
12849  /* "View.MemoryView":504
12850  * cdef Py_ssize_t i
12851  *
12852  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12853  * bytesvalue = struct.pack(self.view.format, *value)
12854  * else:
12855  */
12856  goto __pyx_L3;
12857  }
12858 
12859  /* "View.MemoryView":507
12860  * bytesvalue = struct.pack(self.view.format, *value)
12861  * else:
12862  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12863  *
12864  * for i, c in enumerate(bytesvalue):
12865  */
12866  /*else*/ {
12867  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 507, __pyx_L1_error)
12868  __Pyx_GOTREF(__pyx_t_6);
12869  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 507, __pyx_L1_error)
12870  __Pyx_GOTREF(__pyx_t_1);
12871  __pyx_t_5 = NULL;
12872  __pyx_t_7 = 0;
12873  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12874  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12875  if (likely(__pyx_t_5)) {
12876  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12877  __Pyx_INCREF(__pyx_t_5);
12878  __Pyx_INCREF(function);
12879  __Pyx_DECREF_SET(__pyx_t_6, function);
12880  __pyx_t_7 = 1;
12881  }
12882  }
12883  #if CYTHON_FAST_PYCALL
12884  if (PyFunction_Check(__pyx_t_6)) {
12885  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12886  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12887  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12888  __Pyx_GOTREF(__pyx_t_4);
12889  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12890  } else
12891  #endif
12892  #if CYTHON_FAST_PYCCALL
12893  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12894  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12895  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12896  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12897  __Pyx_GOTREF(__pyx_t_4);
12898  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12899  } else
12900  #endif
12901  {
12902  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 507, __pyx_L1_error)
12903  __Pyx_GOTREF(__pyx_t_8);
12904  if (__pyx_t_5) {
12905  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12906  }
12907  __Pyx_GIVEREF(__pyx_t_1);
12908  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12909  __Pyx_INCREF(__pyx_v_value);
12910  __Pyx_GIVEREF(__pyx_v_value);
12911  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12912  __pyx_t_1 = 0;
12913  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12914  __Pyx_GOTREF(__pyx_t_4);
12915  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12916  }
12917  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12918  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 507, __pyx_L1_error)
12919  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12920  __pyx_t_4 = 0;
12921  }
12922  __pyx_L3:;
12923 
12924  /* "View.MemoryView":509
12925  * bytesvalue = struct.pack(self.view.format, value)
12926  *
12927  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12928  * itemp[i] = c
12929  *
12930  */
12931  __pyx_t_9 = 0;
12932  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12933  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12934  __PYX_ERR(1, 509, __pyx_L1_error)
12935  }
12936  __Pyx_INCREF(__pyx_v_bytesvalue);
12937  __pyx_t_10 = __pyx_v_bytesvalue;
12938  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12939  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12940  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12941  __pyx_t_11 = __pyx_t_14;
12942  __pyx_v_c = (__pyx_t_11[0]);
12943 
12944  /* "View.MemoryView":510
12945  *
12946  * for i, c in enumerate(bytesvalue):
12947  * itemp[i] = c # <<<<<<<<<<<<<<
12948  *
12949  * @cname('getbuffer')
12950  */
12951  __pyx_v_i = __pyx_t_9;
12952 
12953  /* "View.MemoryView":509
12954  * bytesvalue = struct.pack(self.view.format, value)
12955  *
12956  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12957  * itemp[i] = c
12958  *
12959  */
12960  __pyx_t_9 = (__pyx_t_9 + 1);
12961 
12962  /* "View.MemoryView":510
12963  *
12964  * for i, c in enumerate(bytesvalue):
12965  * itemp[i] = c # <<<<<<<<<<<<<<
12966  *
12967  * @cname('getbuffer')
12968  */
12969  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12970  }
12971  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12972 
12973  /* "View.MemoryView":496
12974  * return result
12975  *
12976  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12977  * """Only used if instantiated manually by the user, or if Cython doesn't
12978  * know how to convert the type"""
12979  */
12980 
12981  /* function exit code */
12982  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12983  goto __pyx_L0;
12984  __pyx_L1_error:;
12985  __Pyx_XDECREF(__pyx_t_1);
12986  __Pyx_XDECREF(__pyx_t_4);
12987  __Pyx_XDECREF(__pyx_t_5);
12988  __Pyx_XDECREF(__pyx_t_6);
12989  __Pyx_XDECREF(__pyx_t_8);
12990  __Pyx_XDECREF(__pyx_t_10);
12991  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12992  __pyx_r = 0;
12993  __pyx_L0:;
12994  __Pyx_XDECREF(__pyx_v_struct);
12995  __Pyx_XDECREF(__pyx_v_bytesvalue);
12996  __Pyx_XGIVEREF(__pyx_r);
12997  __Pyx_RefNannyFinishContext();
12998  return __pyx_r;
12999 }
13000 
13001 /* "View.MemoryView":513
13002  *
13003  * @cname('getbuffer')
13004  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13005  * if flags & PyBUF_WRITABLE and self.view.readonly:
13006  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13007  */
13008 
13009 /* Python wrapper */
13010 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13011 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13012  int __pyx_r;
13013  __Pyx_RefNannyDeclarations
13014  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13015  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13016 
13017  /* function exit code */
13018  __Pyx_RefNannyFinishContext();
13019  return __pyx_r;
13020 }
13021 
13022 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13023  int __pyx_r;
13024  __Pyx_RefNannyDeclarations
13025  int __pyx_t_1;
13026  int __pyx_t_2;
13027  PyObject *__pyx_t_3 = NULL;
13028  Py_ssize_t *__pyx_t_4;
13029  char *__pyx_t_5;
13030  void *__pyx_t_6;
13031  int __pyx_t_7;
13032  Py_ssize_t __pyx_t_8;
13033  if (__pyx_v_info == NULL) {
13034  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13035  return -1;
13036  }
13037  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13038  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13039  __Pyx_GIVEREF(__pyx_v_info->obj);
13040 
13041  /* "View.MemoryView":514
13042  * @cname('getbuffer')
13043  * def __getbuffer__(self, Py_buffer *info, int flags):
13044  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13045  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13046  *
13047  */
13048  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13049  if (__pyx_t_2) {
13050  } else {
13051  __pyx_t_1 = __pyx_t_2;
13052  goto __pyx_L4_bool_binop_done;
13053  }
13054  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13055  __pyx_t_1 = __pyx_t_2;
13056  __pyx_L4_bool_binop_done:;
13057  if (unlikely(__pyx_t_1)) {
13058 
13059  /* "View.MemoryView":515
13060  * def __getbuffer__(self, Py_buffer *info, int flags):
13061  * if flags & PyBUF_WRITABLE and self.view.readonly:
13062  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13063  *
13064  * if flags & PyBUF_STRIDES:
13065  */
13066  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 515, __pyx_L1_error)
13067  __Pyx_GOTREF(__pyx_t_3);
13068  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13069  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13070  __PYX_ERR(1, 515, __pyx_L1_error)
13071 
13072  /* "View.MemoryView":514
13073  * @cname('getbuffer')
13074  * def __getbuffer__(self, Py_buffer *info, int flags):
13075  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13076  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13077  *
13078  */
13079  }
13080 
13081  /* "View.MemoryView":517
13082  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13083  *
13084  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13085  * info.shape = self.view.shape
13086  * else:
13087  */
13088  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13089  if (__pyx_t_1) {
13090 
13091  /* "View.MemoryView":518
13092  *
13093  * if flags & PyBUF_STRIDES:
13094  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13095  * else:
13096  * info.shape = NULL
13097  */
13098  __pyx_t_4 = __pyx_v_self->view.shape;
13099  __pyx_v_info->shape = __pyx_t_4;
13100 
13101  /* "View.MemoryView":517
13102  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13103  *
13104  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13105  * info.shape = self.view.shape
13106  * else:
13107  */
13108  goto __pyx_L6;
13109  }
13110 
13111  /* "View.MemoryView":520
13112  * info.shape = self.view.shape
13113  * else:
13114  * info.shape = NULL # <<<<<<<<<<<<<<
13115  *
13116  * if flags & PyBUF_STRIDES:
13117  */
13118  /*else*/ {
13119  __pyx_v_info->shape = NULL;
13120  }
13121  __pyx_L6:;
13122 
13123  /* "View.MemoryView":522
13124  * info.shape = NULL
13125  *
13126  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13127  * info.strides = self.view.strides
13128  * else:
13129  */
13130  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13131  if (__pyx_t_1) {
13132 
13133  /* "View.MemoryView":523
13134  *
13135  * if flags & PyBUF_STRIDES:
13136  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13137  * else:
13138  * info.strides = NULL
13139  */
13140  __pyx_t_4 = __pyx_v_self->view.strides;
13141  __pyx_v_info->strides = __pyx_t_4;
13142 
13143  /* "View.MemoryView":522
13144  * info.shape = NULL
13145  *
13146  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13147  * info.strides = self.view.strides
13148  * else:
13149  */
13150  goto __pyx_L7;
13151  }
13152 
13153  /* "View.MemoryView":525
13154  * info.strides = self.view.strides
13155  * else:
13156  * info.strides = NULL # <<<<<<<<<<<<<<
13157  *
13158  * if flags & PyBUF_INDIRECT:
13159  */
13160  /*else*/ {
13161  __pyx_v_info->strides = NULL;
13162  }
13163  __pyx_L7:;
13164 
13165  /* "View.MemoryView":527
13166  * info.strides = NULL
13167  *
13168  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13169  * info.suboffsets = self.view.suboffsets
13170  * else:
13171  */
13172  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13173  if (__pyx_t_1) {
13174 
13175  /* "View.MemoryView":528
13176  *
13177  * if flags & PyBUF_INDIRECT:
13178  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13179  * else:
13180  * info.suboffsets = NULL
13181  */
13182  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13183  __pyx_v_info->suboffsets = __pyx_t_4;
13184 
13185  /* "View.MemoryView":527
13186  * info.strides = NULL
13187  *
13188  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13189  * info.suboffsets = self.view.suboffsets
13190  * else:
13191  */
13192  goto __pyx_L8;
13193  }
13194 
13195  /* "View.MemoryView":530
13196  * info.suboffsets = self.view.suboffsets
13197  * else:
13198  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13199  *
13200  * if flags & PyBUF_FORMAT:
13201  */
13202  /*else*/ {
13203  __pyx_v_info->suboffsets = NULL;
13204  }
13205  __pyx_L8:;
13206 
13207  /* "View.MemoryView":532
13208  * info.suboffsets = NULL
13209  *
13210  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13211  * info.format = self.view.format
13212  * else:
13213  */
13214  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13215  if (__pyx_t_1) {
13216 
13217  /* "View.MemoryView":533
13218  *
13219  * if flags & PyBUF_FORMAT:
13220  * info.format = self.view.format # <<<<<<<<<<<<<<
13221  * else:
13222  * info.format = NULL
13223  */
13224  __pyx_t_5 = __pyx_v_self->view.format;
13225  __pyx_v_info->format = __pyx_t_5;
13226 
13227  /* "View.MemoryView":532
13228  * info.suboffsets = NULL
13229  *
13230  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13231  * info.format = self.view.format
13232  * else:
13233  */
13234  goto __pyx_L9;
13235  }
13236 
13237  /* "View.MemoryView":535
13238  * info.format = self.view.format
13239  * else:
13240  * info.format = NULL # <<<<<<<<<<<<<<
13241  *
13242  * info.buf = self.view.buf
13243  */
13244  /*else*/ {
13245  __pyx_v_info->format = NULL;
13246  }
13247  __pyx_L9:;
13248 
13249  /* "View.MemoryView":537
13250  * info.format = NULL
13251  *
13252  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13253  * info.ndim = self.view.ndim
13254  * info.itemsize = self.view.itemsize
13255  */
13256  __pyx_t_6 = __pyx_v_self->view.buf;
13257  __pyx_v_info->buf = __pyx_t_6;
13258 
13259  /* "View.MemoryView":538
13260  *
13261  * info.buf = self.view.buf
13262  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13263  * info.itemsize = self.view.itemsize
13264  * info.len = self.view.len
13265  */
13266  __pyx_t_7 = __pyx_v_self->view.ndim;
13267  __pyx_v_info->ndim = __pyx_t_7;
13268 
13269  /* "View.MemoryView":539
13270  * info.buf = self.view.buf
13271  * info.ndim = self.view.ndim
13272  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13273  * info.len = self.view.len
13274  * info.readonly = self.view.readonly
13275  */
13276  __pyx_t_8 = __pyx_v_self->view.itemsize;
13277  __pyx_v_info->itemsize = __pyx_t_8;
13278 
13279  /* "View.MemoryView":540
13280  * info.ndim = self.view.ndim
13281  * info.itemsize = self.view.itemsize
13282  * info.len = self.view.len # <<<<<<<<<<<<<<
13283  * info.readonly = self.view.readonly
13284  * info.obj = self
13285  */
13286  __pyx_t_8 = __pyx_v_self->view.len;
13287  __pyx_v_info->len = __pyx_t_8;
13288 
13289  /* "View.MemoryView":541
13290  * info.itemsize = self.view.itemsize
13291  * info.len = self.view.len
13292  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13293  * info.obj = self
13294  *
13295  */
13296  __pyx_t_1 = __pyx_v_self->view.readonly;
13297  __pyx_v_info->readonly = __pyx_t_1;
13298 
13299  /* "View.MemoryView":542
13300  * info.len = self.view.len
13301  * info.readonly = self.view.readonly
13302  * info.obj = self # <<<<<<<<<<<<<<
13303  *
13304  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13305  */
13306  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13307  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13308  __Pyx_GOTREF(__pyx_v_info->obj);
13309  __Pyx_DECREF(__pyx_v_info->obj);
13310  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13311 
13312  /* "View.MemoryView":513
13313  *
13314  * @cname('getbuffer')
13315  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13316  * if flags & PyBUF_WRITABLE and self.view.readonly:
13317  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13318  */
13319 
13320  /* function exit code */
13321  __pyx_r = 0;
13322  goto __pyx_L0;
13323  __pyx_L1_error:;
13324  __Pyx_XDECREF(__pyx_t_3);
13325  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13326  __pyx_r = -1;
13327  if (__pyx_v_info->obj != NULL) {
13328  __Pyx_GOTREF(__pyx_v_info->obj);
13329  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13330  }
13331  goto __pyx_L2;
13332  __pyx_L0:;
13333  if (__pyx_v_info->obj == Py_None) {
13334  __Pyx_GOTREF(__pyx_v_info->obj);
13335  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13336  }
13337  __pyx_L2:;
13338  __Pyx_RefNannyFinishContext();
13339  return __pyx_r;
13340 }
13341 
13342 /* "View.MemoryView":548
13343  *
13344  * @property
13345  * def T(self): # <<<<<<<<<<<<<<
13346  * cdef _memoryviewslice result = memoryview_copy(self)
13347  * transpose_memslice(&result.from_slice)
13348  */
13349 
13350 /* Python wrapper */
13351 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13352 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13353  PyObject *__pyx_r = 0;
13354  __Pyx_RefNannyDeclarations
13355  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13356  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13357 
13358  /* function exit code */
13359  __Pyx_RefNannyFinishContext();
13360  return __pyx_r;
13361 }
13362 
13363 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13364  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13365  PyObject *__pyx_r = NULL;
13366  __Pyx_RefNannyDeclarations
13367  PyObject *__pyx_t_1 = NULL;
13368  int __pyx_t_2;
13369  __Pyx_RefNannySetupContext("__get__", 0);
13370 
13371  /* "View.MemoryView":549
13372  * @property
13373  * def T(self):
13374  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13375  * transpose_memslice(&result.from_slice)
13376  * return result
13377  */
13378  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
13379  __Pyx_GOTREF(__pyx_t_1);
13380  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 549, __pyx_L1_error)
13381  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13382  __pyx_t_1 = 0;
13383 
13384  /* "View.MemoryView":550
13385  * def T(self):
13386  * cdef _memoryviewslice result = memoryview_copy(self)
13387  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13388  * return result
13389  *
13390  */
13391  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 550, __pyx_L1_error)
13392 
13393  /* "View.MemoryView":551
13394  * cdef _memoryviewslice result = memoryview_copy(self)
13395  * transpose_memslice(&result.from_slice)
13396  * return result # <<<<<<<<<<<<<<
13397  *
13398  * @property
13399  */
13400  __Pyx_XDECREF(__pyx_r);
13401  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13402  __pyx_r = ((PyObject *)__pyx_v_result);
13403  goto __pyx_L0;
13404 
13405  /* "View.MemoryView":548
13406  *
13407  * @property
13408  * def T(self): # <<<<<<<<<<<<<<
13409  * cdef _memoryviewslice result = memoryview_copy(self)
13410  * transpose_memslice(&result.from_slice)
13411  */
13412 
13413  /* function exit code */
13414  __pyx_L1_error:;
13415  __Pyx_XDECREF(__pyx_t_1);
13416  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13417  __pyx_r = NULL;
13418  __pyx_L0:;
13419  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13420  __Pyx_XGIVEREF(__pyx_r);
13421  __Pyx_RefNannyFinishContext();
13422  return __pyx_r;
13423 }
13424 
13425 /* "View.MemoryView":554
13426  *
13427  * @property
13428  * def base(self): # <<<<<<<<<<<<<<
13429  * return self.obj
13430  *
13431  */
13432 
13433 /* Python wrapper */
13434 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13435 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13436  PyObject *__pyx_r = 0;
13437  __Pyx_RefNannyDeclarations
13438  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13439  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13440 
13441  /* function exit code */
13442  __Pyx_RefNannyFinishContext();
13443  return __pyx_r;
13444 }
13445 
13446 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13447  PyObject *__pyx_r = NULL;
13448  __Pyx_RefNannyDeclarations
13449  __Pyx_RefNannySetupContext("__get__", 0);
13450 
13451  /* "View.MemoryView":555
13452  * @property
13453  * def base(self):
13454  * return self.obj # <<<<<<<<<<<<<<
13455  *
13456  * @property
13457  */
13458  __Pyx_XDECREF(__pyx_r);
13459  __Pyx_INCREF(__pyx_v_self->obj);
13460  __pyx_r = __pyx_v_self->obj;
13461  goto __pyx_L0;
13462 
13463  /* "View.MemoryView":554
13464  *
13465  * @property
13466  * def base(self): # <<<<<<<<<<<<<<
13467  * return self.obj
13468  *
13469  */
13470 
13471  /* function exit code */
13472  __pyx_L0:;
13473  __Pyx_XGIVEREF(__pyx_r);
13474  __Pyx_RefNannyFinishContext();
13475  return __pyx_r;
13476 }
13477 
13478 /* "View.MemoryView":558
13479  *
13480  * @property
13481  * def shape(self): # <<<<<<<<<<<<<<
13482  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13483  *
13484  */
13485 
13486 /* Python wrapper */
13487 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13488 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13489  PyObject *__pyx_r = 0;
13490  __Pyx_RefNannyDeclarations
13491  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13492  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13493 
13494  /* function exit code */
13495  __Pyx_RefNannyFinishContext();
13496  return __pyx_r;
13497 }
13498 
13499 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13500  Py_ssize_t __pyx_v_length;
13501  PyObject *__pyx_r = NULL;
13502  __Pyx_RefNannyDeclarations
13503  PyObject *__pyx_t_1 = NULL;
13504  Py_ssize_t *__pyx_t_2;
13505  Py_ssize_t *__pyx_t_3;
13506  Py_ssize_t *__pyx_t_4;
13507  PyObject *__pyx_t_5 = NULL;
13508  __Pyx_RefNannySetupContext("__get__", 0);
13509 
13510  /* "View.MemoryView":559
13511  * @property
13512  * def shape(self):
13513  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13514  *
13515  * @property
13516  */
13517  __Pyx_XDECREF(__pyx_r);
13518  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
13519  __Pyx_GOTREF(__pyx_t_1);
13520  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13521  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13522  __pyx_t_2 = __pyx_t_4;
13523  __pyx_v_length = (__pyx_t_2[0]);
13524  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
13525  __Pyx_GOTREF(__pyx_t_5);
13526  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 559, __pyx_L1_error)
13527  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13528  }
13529  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
13530  __Pyx_GOTREF(__pyx_t_5);
13531  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13532  __pyx_r = __pyx_t_5;
13533  __pyx_t_5 = 0;
13534  goto __pyx_L0;
13535 
13536  /* "View.MemoryView":558
13537  *
13538  * @property
13539  * def shape(self): # <<<<<<<<<<<<<<
13540  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13541  *
13542  */
13543 
13544  /* function exit code */
13545  __pyx_L1_error:;
13546  __Pyx_XDECREF(__pyx_t_1);
13547  __Pyx_XDECREF(__pyx_t_5);
13548  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13549  __pyx_r = NULL;
13550  __pyx_L0:;
13551  __Pyx_XGIVEREF(__pyx_r);
13552  __Pyx_RefNannyFinishContext();
13553  return __pyx_r;
13554 }
13555 
13556 /* "View.MemoryView":562
13557  *
13558  * @property
13559  * def strides(self): # <<<<<<<<<<<<<<
13560  * if self.view.strides == NULL:
13561  *
13562  */
13563 
13564 /* Python wrapper */
13565 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13566 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13567  PyObject *__pyx_r = 0;
13568  __Pyx_RefNannyDeclarations
13569  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13570  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13571 
13572  /* function exit code */
13573  __Pyx_RefNannyFinishContext();
13574  return __pyx_r;
13575 }
13576 
13577 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13578  Py_ssize_t __pyx_v_stride;
13579  PyObject *__pyx_r = NULL;
13580  __Pyx_RefNannyDeclarations
13581  int __pyx_t_1;
13582  PyObject *__pyx_t_2 = NULL;
13583  Py_ssize_t *__pyx_t_3;
13584  Py_ssize_t *__pyx_t_4;
13585  Py_ssize_t *__pyx_t_5;
13586  PyObject *__pyx_t_6 = NULL;
13587  __Pyx_RefNannySetupContext("__get__", 0);
13588 
13589  /* "View.MemoryView":563
13590  * @property
13591  * def strides(self):
13592  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13593  *
13594  * raise ValueError("Buffer view does not expose strides")
13595  */
13596  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13597  if (unlikely(__pyx_t_1)) {
13598 
13599  /* "View.MemoryView":565
13600  * if self.view.strides == NULL:
13601  *
13602  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13603  *
13604  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13605  */
13606  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
13607  __Pyx_GOTREF(__pyx_t_2);
13608  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13609  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13610  __PYX_ERR(1, 565, __pyx_L1_error)
13611 
13612  /* "View.MemoryView":563
13613  * @property
13614  * def strides(self):
13615  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13616  *
13617  * raise ValueError("Buffer view does not expose strides")
13618  */
13619  }
13620 
13621  /* "View.MemoryView":567
13622  * raise ValueError("Buffer view does not expose strides")
13623  *
13624  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13625  *
13626  * @property
13627  */
13628  __Pyx_XDECREF(__pyx_r);
13629  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __pyx_L1_error)
13630  __Pyx_GOTREF(__pyx_t_2);
13631  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13632  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13633  __pyx_t_3 = __pyx_t_5;
13634  __pyx_v_stride = (__pyx_t_3[0]);
13635  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
13636  __Pyx_GOTREF(__pyx_t_6);
13637  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 567, __pyx_L1_error)
13638  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13639  }
13640  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
13641  __Pyx_GOTREF(__pyx_t_6);
13642  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13643  __pyx_r = __pyx_t_6;
13644  __pyx_t_6 = 0;
13645  goto __pyx_L0;
13646 
13647  /* "View.MemoryView":562
13648  *
13649  * @property
13650  * def strides(self): # <<<<<<<<<<<<<<
13651  * if self.view.strides == NULL:
13652  *
13653  */
13654 
13655  /* function exit code */
13656  __pyx_L1_error:;
13657  __Pyx_XDECREF(__pyx_t_2);
13658  __Pyx_XDECREF(__pyx_t_6);
13659  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13660  __pyx_r = NULL;
13661  __pyx_L0:;
13662  __Pyx_XGIVEREF(__pyx_r);
13663  __Pyx_RefNannyFinishContext();
13664  return __pyx_r;
13665 }
13666 
13667 /* "View.MemoryView":570
13668  *
13669  * @property
13670  * def suboffsets(self): # <<<<<<<<<<<<<<
13671  * if self.view.suboffsets == NULL:
13672  * return (-1,) * self.view.ndim
13673  */
13674 
13675 /* Python wrapper */
13676 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13677 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13678  PyObject *__pyx_r = 0;
13679  __Pyx_RefNannyDeclarations
13680  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13681  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13682 
13683  /* function exit code */
13684  __Pyx_RefNannyFinishContext();
13685  return __pyx_r;
13686 }
13687 
13688 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13689  Py_ssize_t __pyx_v_suboffset;
13690  PyObject *__pyx_r = NULL;
13691  __Pyx_RefNannyDeclarations
13692  int __pyx_t_1;
13693  PyObject *__pyx_t_2 = NULL;
13694  PyObject *__pyx_t_3 = NULL;
13695  Py_ssize_t *__pyx_t_4;
13696  Py_ssize_t *__pyx_t_5;
13697  Py_ssize_t *__pyx_t_6;
13698  __Pyx_RefNannySetupContext("__get__", 0);
13699 
13700  /* "View.MemoryView":571
13701  * @property
13702  * def suboffsets(self):
13703  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13704  * return (-1,) * self.view.ndim
13705  *
13706  */
13707  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13708  if (__pyx_t_1) {
13709 
13710  /* "View.MemoryView":572
13711  * def suboffsets(self):
13712  * if self.view.suboffsets == NULL:
13713  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13714  *
13715  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13716  */
13717  __Pyx_XDECREF(__pyx_r);
13718  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13719  __Pyx_GOTREF(__pyx_t_2);
13720  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__27, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 572, __pyx_L1_error)
13721  __Pyx_GOTREF(__pyx_t_3);
13722  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13723  __pyx_r = __pyx_t_3;
13724  __pyx_t_3 = 0;
13725  goto __pyx_L0;
13726 
13727  /* "View.MemoryView":571
13728  * @property
13729  * def suboffsets(self):
13730  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13731  * return (-1,) * self.view.ndim
13732  *
13733  */
13734  }
13735 
13736  /* "View.MemoryView":574
13737  * return (-1,) * self.view.ndim
13738  *
13739  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13740  *
13741  * @property
13742  */
13743  __Pyx_XDECREF(__pyx_r);
13744  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 574, __pyx_L1_error)
13745  __Pyx_GOTREF(__pyx_t_3);
13746  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13747  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13748  __pyx_t_4 = __pyx_t_6;
13749  __pyx_v_suboffset = (__pyx_t_4[0]);
13750  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
13751  __Pyx_GOTREF(__pyx_t_2);
13752  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 574, __pyx_L1_error)
13753  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13754  }
13755  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
13756  __Pyx_GOTREF(__pyx_t_2);
13757  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13758  __pyx_r = __pyx_t_2;
13759  __pyx_t_2 = 0;
13760  goto __pyx_L0;
13761 
13762  /* "View.MemoryView":570
13763  *
13764  * @property
13765  * def suboffsets(self): # <<<<<<<<<<<<<<
13766  * if self.view.suboffsets == NULL:
13767  * return (-1,) * self.view.ndim
13768  */
13769 
13770  /* function exit code */
13771  __pyx_L1_error:;
13772  __Pyx_XDECREF(__pyx_t_2);
13773  __Pyx_XDECREF(__pyx_t_3);
13774  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13775  __pyx_r = NULL;
13776  __pyx_L0:;
13777  __Pyx_XGIVEREF(__pyx_r);
13778  __Pyx_RefNannyFinishContext();
13779  return __pyx_r;
13780 }
13781 
13782 /* "View.MemoryView":577
13783  *
13784  * @property
13785  * def ndim(self): # <<<<<<<<<<<<<<
13786  * return self.view.ndim
13787  *
13788  */
13789 
13790 /* Python wrapper */
13791 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13792 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13793  PyObject *__pyx_r = 0;
13794  __Pyx_RefNannyDeclarations
13795  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13796  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13797 
13798  /* function exit code */
13799  __Pyx_RefNannyFinishContext();
13800  return __pyx_r;
13801 }
13802 
13803 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13804  PyObject *__pyx_r = NULL;
13805  __Pyx_RefNannyDeclarations
13806  PyObject *__pyx_t_1 = NULL;
13807  __Pyx_RefNannySetupContext("__get__", 0);
13808 
13809  /* "View.MemoryView":578
13810  * @property
13811  * def ndim(self):
13812  * return self.view.ndim # <<<<<<<<<<<<<<
13813  *
13814  * @property
13815  */
13816  __Pyx_XDECREF(__pyx_r);
13817  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 578, __pyx_L1_error)
13818  __Pyx_GOTREF(__pyx_t_1);
13819  __pyx_r = __pyx_t_1;
13820  __pyx_t_1 = 0;
13821  goto __pyx_L0;
13822 
13823  /* "View.MemoryView":577
13824  *
13825  * @property
13826  * def ndim(self): # <<<<<<<<<<<<<<
13827  * return self.view.ndim
13828  *
13829  */
13830 
13831  /* function exit code */
13832  __pyx_L1_error:;
13833  __Pyx_XDECREF(__pyx_t_1);
13834  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13835  __pyx_r = NULL;
13836  __pyx_L0:;
13837  __Pyx_XGIVEREF(__pyx_r);
13838  __Pyx_RefNannyFinishContext();
13839  return __pyx_r;
13840 }
13841 
13842 /* "View.MemoryView":581
13843  *
13844  * @property
13845  * def itemsize(self): # <<<<<<<<<<<<<<
13846  * return self.view.itemsize
13847  *
13848  */
13849 
13850 /* Python wrapper */
13851 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13852 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13853  PyObject *__pyx_r = 0;
13854  __Pyx_RefNannyDeclarations
13855  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13856  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13857 
13858  /* function exit code */
13859  __Pyx_RefNannyFinishContext();
13860  return __pyx_r;
13861 }
13862 
13863 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13864  PyObject *__pyx_r = NULL;
13865  __Pyx_RefNannyDeclarations
13866  PyObject *__pyx_t_1 = NULL;
13867  __Pyx_RefNannySetupContext("__get__", 0);
13868 
13869  /* "View.MemoryView":582
13870  * @property
13871  * def itemsize(self):
13872  * return self.view.itemsize # <<<<<<<<<<<<<<
13873  *
13874  * @property
13875  */
13876  __Pyx_XDECREF(__pyx_r);
13877  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
13878  __Pyx_GOTREF(__pyx_t_1);
13879  __pyx_r = __pyx_t_1;
13880  __pyx_t_1 = 0;
13881  goto __pyx_L0;
13882 
13883  /* "View.MemoryView":581
13884  *
13885  * @property
13886  * def itemsize(self): # <<<<<<<<<<<<<<
13887  * return self.view.itemsize
13888  *
13889  */
13890 
13891  /* function exit code */
13892  __pyx_L1_error:;
13893  __Pyx_XDECREF(__pyx_t_1);
13894  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13895  __pyx_r = NULL;
13896  __pyx_L0:;
13897  __Pyx_XGIVEREF(__pyx_r);
13898  __Pyx_RefNannyFinishContext();
13899  return __pyx_r;
13900 }
13901 
13902 /* "View.MemoryView":585
13903  *
13904  * @property
13905  * def nbytes(self): # <<<<<<<<<<<<<<
13906  * return self.size * self.view.itemsize
13907  *
13908  */
13909 
13910 /* Python wrapper */
13911 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13912 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13913  PyObject *__pyx_r = 0;
13914  __Pyx_RefNannyDeclarations
13915  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13916  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13917 
13918  /* function exit code */
13919  __Pyx_RefNannyFinishContext();
13920  return __pyx_r;
13921 }
13922 
13923 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13924  PyObject *__pyx_r = NULL;
13925  __Pyx_RefNannyDeclarations
13926  PyObject *__pyx_t_1 = NULL;
13927  PyObject *__pyx_t_2 = NULL;
13928  PyObject *__pyx_t_3 = NULL;
13929  __Pyx_RefNannySetupContext("__get__", 0);
13930 
13931  /* "View.MemoryView":586
13932  * @property
13933  * def nbytes(self):
13934  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13935  *
13936  * @property
13937  */
13938  __Pyx_XDECREF(__pyx_r);
13939  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
13940  __Pyx_GOTREF(__pyx_t_1);
13941  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 586, __pyx_L1_error)
13942  __Pyx_GOTREF(__pyx_t_2);
13943  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
13944  __Pyx_GOTREF(__pyx_t_3);
13945  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13946  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13947  __pyx_r = __pyx_t_3;
13948  __pyx_t_3 = 0;
13949  goto __pyx_L0;
13950 
13951  /* "View.MemoryView":585
13952  *
13953  * @property
13954  * def nbytes(self): # <<<<<<<<<<<<<<
13955  * return self.size * self.view.itemsize
13956  *
13957  */
13958 
13959  /* function exit code */
13960  __pyx_L1_error:;
13961  __Pyx_XDECREF(__pyx_t_1);
13962  __Pyx_XDECREF(__pyx_t_2);
13963  __Pyx_XDECREF(__pyx_t_3);
13964  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13965  __pyx_r = NULL;
13966  __pyx_L0:;
13967  __Pyx_XGIVEREF(__pyx_r);
13968  __Pyx_RefNannyFinishContext();
13969  return __pyx_r;
13970 }
13971 
13972 /* "View.MemoryView":589
13973  *
13974  * @property
13975  * def size(self): # <<<<<<<<<<<<<<
13976  * if self._size is None:
13977  * result = 1
13978  */
13979 
13980 /* Python wrapper */
13981 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13982 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13983  PyObject *__pyx_r = 0;
13984  __Pyx_RefNannyDeclarations
13985  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13986  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13987 
13988  /* function exit code */
13989  __Pyx_RefNannyFinishContext();
13990  return __pyx_r;
13991 }
13992 
13993 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13994  PyObject *__pyx_v_result = NULL;
13995  PyObject *__pyx_v_length = NULL;
13996  PyObject *__pyx_r = NULL;
13997  __Pyx_RefNannyDeclarations
13998  int __pyx_t_1;
13999  int __pyx_t_2;
14000  Py_ssize_t *__pyx_t_3;
14001  Py_ssize_t *__pyx_t_4;
14002  Py_ssize_t *__pyx_t_5;
14003  PyObject *__pyx_t_6 = NULL;
14004  __Pyx_RefNannySetupContext("__get__", 0);
14005 
14006  /* "View.MemoryView":590
14007  * @property
14008  * def size(self):
14009  * if self._size is None: # <<<<<<<<<<<<<<
14010  * result = 1
14011  *
14012  */
14013  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14014  __pyx_t_2 = (__pyx_t_1 != 0);
14015  if (__pyx_t_2) {
14016 
14017  /* "View.MemoryView":591
14018  * def size(self):
14019  * if self._size is None:
14020  * result = 1 # <<<<<<<<<<<<<<
14021  *
14022  * for length in self.view.shape[:self.view.ndim]:
14023  */
14024  __Pyx_INCREF(__pyx_int_1);
14025  __pyx_v_result = __pyx_int_1;
14026 
14027  /* "View.MemoryView":593
14028  * result = 1
14029  *
14030  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14031  * result *= length
14032  *
14033  */
14034  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14035  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14036  __pyx_t_3 = __pyx_t_5;
14037  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 593, __pyx_L1_error)
14038  __Pyx_GOTREF(__pyx_t_6);
14039  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14040  __pyx_t_6 = 0;
14041 
14042  /* "View.MemoryView":594
14043  *
14044  * for length in self.view.shape[:self.view.ndim]:
14045  * result *= length # <<<<<<<<<<<<<<
14046  *
14047  * self._size = result
14048  */
14049  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
14050  __Pyx_GOTREF(__pyx_t_6);
14051  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14052  __pyx_t_6 = 0;
14053  }
14054 
14055  /* "View.MemoryView":596
14056  * result *= length
14057  *
14058  * self._size = result # <<<<<<<<<<<<<<
14059  *
14060  * return self._size
14061  */
14062  __Pyx_INCREF(__pyx_v_result);
14063  __Pyx_GIVEREF(__pyx_v_result);
14064  __Pyx_GOTREF(__pyx_v_self->_size);
14065  __Pyx_DECREF(__pyx_v_self->_size);
14066  __pyx_v_self->_size = __pyx_v_result;
14067 
14068  /* "View.MemoryView":590
14069  * @property
14070  * def size(self):
14071  * if self._size is None: # <<<<<<<<<<<<<<
14072  * result = 1
14073  *
14074  */
14075  }
14076 
14077  /* "View.MemoryView":598
14078  * self._size = result
14079  *
14080  * return self._size # <<<<<<<<<<<<<<
14081  *
14082  * def __len__(self):
14083  */
14084  __Pyx_XDECREF(__pyx_r);
14085  __Pyx_INCREF(__pyx_v_self->_size);
14086  __pyx_r = __pyx_v_self->_size;
14087  goto __pyx_L0;
14088 
14089  /* "View.MemoryView":589
14090  *
14091  * @property
14092  * def size(self): # <<<<<<<<<<<<<<
14093  * if self._size is None:
14094  * result = 1
14095  */
14096 
14097  /* function exit code */
14098  __pyx_L1_error:;
14099  __Pyx_XDECREF(__pyx_t_6);
14100  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14101  __pyx_r = NULL;
14102  __pyx_L0:;
14103  __Pyx_XDECREF(__pyx_v_result);
14104  __Pyx_XDECREF(__pyx_v_length);
14105  __Pyx_XGIVEREF(__pyx_r);
14106  __Pyx_RefNannyFinishContext();
14107  return __pyx_r;
14108 }
14109 
14110 /* "View.MemoryView":600
14111  * return self._size
14112  *
14113  * def __len__(self): # <<<<<<<<<<<<<<
14114  * if self.view.ndim >= 1:
14115  * return self.view.shape[0]
14116  */
14117 
14118 /* Python wrapper */
14119 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14120 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14121  Py_ssize_t __pyx_r;
14122  __Pyx_RefNannyDeclarations
14123  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14124  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14125 
14126  /* function exit code */
14127  __Pyx_RefNannyFinishContext();
14128  return __pyx_r;
14129 }
14130 
14131 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14132  Py_ssize_t __pyx_r;
14133  __Pyx_RefNannyDeclarations
14134  int __pyx_t_1;
14135  __Pyx_RefNannySetupContext("__len__", 0);
14136 
14137  /* "View.MemoryView":601
14138  *
14139  * def __len__(self):
14140  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14141  * return self.view.shape[0]
14142  *
14143  */
14144  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14145  if (__pyx_t_1) {
14146 
14147  /* "View.MemoryView":602
14148  * def __len__(self):
14149  * if self.view.ndim >= 1:
14150  * return self.view.shape[0] # <<<<<<<<<<<<<<
14151  *
14152  * return 0
14153  */
14154  __pyx_r = (__pyx_v_self->view.shape[0]);
14155  goto __pyx_L0;
14156 
14157  /* "View.MemoryView":601
14158  *
14159  * def __len__(self):
14160  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14161  * return self.view.shape[0]
14162  *
14163  */
14164  }
14165 
14166  /* "View.MemoryView":604
14167  * return self.view.shape[0]
14168  *
14169  * return 0 # <<<<<<<<<<<<<<
14170  *
14171  * def __repr__(self):
14172  */
14173  __pyx_r = 0;
14174  goto __pyx_L0;
14175 
14176  /* "View.MemoryView":600
14177  * return self._size
14178  *
14179  * def __len__(self): # <<<<<<<<<<<<<<
14180  * if self.view.ndim >= 1:
14181  * return self.view.shape[0]
14182  */
14183 
14184  /* function exit code */
14185  __pyx_L0:;
14186  __Pyx_RefNannyFinishContext();
14187  return __pyx_r;
14188 }
14189 
14190 /* "View.MemoryView":606
14191  * return 0
14192  *
14193  * def __repr__(self): # <<<<<<<<<<<<<<
14194  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14195  * id(self))
14196  */
14197 
14198 /* Python wrapper */
14199 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14200 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14201  PyObject *__pyx_r = 0;
14202  __Pyx_RefNannyDeclarations
14203  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14204  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14205 
14206  /* function exit code */
14207  __Pyx_RefNannyFinishContext();
14208  return __pyx_r;
14209 }
14210 
14211 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14212  PyObject *__pyx_r = NULL;
14213  __Pyx_RefNannyDeclarations
14214  PyObject *__pyx_t_1 = NULL;
14215  PyObject *__pyx_t_2 = NULL;
14216  PyObject *__pyx_t_3 = NULL;
14217  __Pyx_RefNannySetupContext("__repr__", 0);
14218 
14219  /* "View.MemoryView":607
14220  *
14221  * def __repr__(self):
14222  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14223  * id(self))
14224  *
14225  */
14226  __Pyx_XDECREF(__pyx_r);
14227  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
14228  __Pyx_GOTREF(__pyx_t_1);
14229  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
14230  __Pyx_GOTREF(__pyx_t_2);
14231  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14232  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
14233  __Pyx_GOTREF(__pyx_t_1);
14234  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14235 
14236  /* "View.MemoryView":608
14237  * def __repr__(self):
14238  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14239  * id(self)) # <<<<<<<<<<<<<<
14240  *
14241  * def __str__(self):
14242  */
14243  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
14244  __Pyx_GOTREF(__pyx_t_2);
14245 
14246  /* "View.MemoryView":607
14247  *
14248  * def __repr__(self):
14249  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14250  * id(self))
14251  *
14252  */
14253  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 607, __pyx_L1_error)
14254  __Pyx_GOTREF(__pyx_t_3);
14255  __Pyx_GIVEREF(__pyx_t_1);
14256  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14257  __Pyx_GIVEREF(__pyx_t_2);
14258  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14259  __pyx_t_1 = 0;
14260  __pyx_t_2 = 0;
14261  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
14262  __Pyx_GOTREF(__pyx_t_2);
14263  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14264  __pyx_r = __pyx_t_2;
14265  __pyx_t_2 = 0;
14266  goto __pyx_L0;
14267 
14268  /* "View.MemoryView":606
14269  * return 0
14270  *
14271  * def __repr__(self): # <<<<<<<<<<<<<<
14272  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14273  * id(self))
14274  */
14275 
14276  /* function exit code */
14277  __pyx_L1_error:;
14278  __Pyx_XDECREF(__pyx_t_1);
14279  __Pyx_XDECREF(__pyx_t_2);
14280  __Pyx_XDECREF(__pyx_t_3);
14281  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14282  __pyx_r = NULL;
14283  __pyx_L0:;
14284  __Pyx_XGIVEREF(__pyx_r);
14285  __Pyx_RefNannyFinishContext();
14286  return __pyx_r;
14287 }
14288 
14289 /* "View.MemoryView":610
14290  * id(self))
14291  *
14292  * def __str__(self): # <<<<<<<<<<<<<<
14293  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14294  *
14295  */
14296 
14297 /* Python wrapper */
14298 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14299 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14300  PyObject *__pyx_r = 0;
14301  __Pyx_RefNannyDeclarations
14302  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14303  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14304 
14305  /* function exit code */
14306  __Pyx_RefNannyFinishContext();
14307  return __pyx_r;
14308 }
14309 
14310 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14311  PyObject *__pyx_r = NULL;
14312  __Pyx_RefNannyDeclarations
14313  PyObject *__pyx_t_1 = NULL;
14314  PyObject *__pyx_t_2 = NULL;
14315  __Pyx_RefNannySetupContext("__str__", 0);
14316 
14317  /* "View.MemoryView":611
14318  *
14319  * def __str__(self):
14320  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14321  *
14322  *
14323  */
14324  __Pyx_XDECREF(__pyx_r);
14325  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14326  __Pyx_GOTREF(__pyx_t_1);
14327  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
14328  __Pyx_GOTREF(__pyx_t_2);
14329  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14330  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14331  __Pyx_GOTREF(__pyx_t_1);
14332  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14333  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
14334  __Pyx_GOTREF(__pyx_t_2);
14335  __Pyx_GIVEREF(__pyx_t_1);
14336  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14337  __pyx_t_1 = 0;
14338  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14339  __Pyx_GOTREF(__pyx_t_1);
14340  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14341  __pyx_r = __pyx_t_1;
14342  __pyx_t_1 = 0;
14343  goto __pyx_L0;
14344 
14345  /* "View.MemoryView":610
14346  * id(self))
14347  *
14348  * def __str__(self): # <<<<<<<<<<<<<<
14349  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14350  *
14351  */
14352 
14353  /* function exit code */
14354  __pyx_L1_error:;
14355  __Pyx_XDECREF(__pyx_t_1);
14356  __Pyx_XDECREF(__pyx_t_2);
14357  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14358  __pyx_r = NULL;
14359  __pyx_L0:;
14360  __Pyx_XGIVEREF(__pyx_r);
14361  __Pyx_RefNannyFinishContext();
14362  return __pyx_r;
14363 }
14364 
14365 /* "View.MemoryView":614
14366  *
14367  *
14368  * def is_c_contig(self): # <<<<<<<<<<<<<<
14369  * cdef __Pyx_memviewslice *mslice
14370  * cdef __Pyx_memviewslice tmp
14371  */
14372 
14373 /* Python wrapper */
14374 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14375 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14376  PyObject *__pyx_r = 0;
14377  __Pyx_RefNannyDeclarations
14378  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14379  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14380 
14381  /* function exit code */
14382  __Pyx_RefNannyFinishContext();
14383  return __pyx_r;
14384 }
14385 
14386 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14387  __Pyx_memviewslice *__pyx_v_mslice;
14388  __Pyx_memviewslice __pyx_v_tmp;
14389  PyObject *__pyx_r = NULL;
14390  __Pyx_RefNannyDeclarations
14391  PyObject *__pyx_t_1 = NULL;
14392  __Pyx_RefNannySetupContext("is_c_contig", 0);
14393 
14394  /* "View.MemoryView":617
14395  * cdef __Pyx_memviewslice *mslice
14396  * cdef __Pyx_memviewslice tmp
14397  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14398  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14399  *
14400  */
14401  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
14402 
14403  /* "View.MemoryView":618
14404  * cdef __Pyx_memviewslice tmp
14405  * mslice = get_slice_from_memview(self, &tmp)
14406  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14407  *
14408  * def is_f_contig(self):
14409  */
14410  __Pyx_XDECREF(__pyx_r);
14411  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
14412  __Pyx_GOTREF(__pyx_t_1);
14413  __pyx_r = __pyx_t_1;
14414  __pyx_t_1 = 0;
14415  goto __pyx_L0;
14416 
14417  /* "View.MemoryView":614
14418  *
14419  *
14420  * def is_c_contig(self): # <<<<<<<<<<<<<<
14421  * cdef __Pyx_memviewslice *mslice
14422  * cdef __Pyx_memviewslice tmp
14423  */
14424 
14425  /* function exit code */
14426  __pyx_L1_error:;
14427  __Pyx_XDECREF(__pyx_t_1);
14428  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14429  __pyx_r = NULL;
14430  __pyx_L0:;
14431  __Pyx_XGIVEREF(__pyx_r);
14432  __Pyx_RefNannyFinishContext();
14433  return __pyx_r;
14434 }
14435 
14436 /* "View.MemoryView":620
14437  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14438  *
14439  * def is_f_contig(self): # <<<<<<<<<<<<<<
14440  * cdef __Pyx_memviewslice *mslice
14441  * cdef __Pyx_memviewslice tmp
14442  */
14443 
14444 /* Python wrapper */
14445 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14446 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14447  PyObject *__pyx_r = 0;
14448  __Pyx_RefNannyDeclarations
14449  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14450  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14451 
14452  /* function exit code */
14453  __Pyx_RefNannyFinishContext();
14454  return __pyx_r;
14455 }
14456 
14457 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14458  __Pyx_memviewslice *__pyx_v_mslice;
14459  __Pyx_memviewslice __pyx_v_tmp;
14460  PyObject *__pyx_r = NULL;
14461  __Pyx_RefNannyDeclarations
14462  PyObject *__pyx_t_1 = NULL;
14463  __Pyx_RefNannySetupContext("is_f_contig", 0);
14464 
14465  /* "View.MemoryView":623
14466  * cdef __Pyx_memviewslice *mslice
14467  * cdef __Pyx_memviewslice tmp
14468  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14469  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14470  *
14471  */
14472  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
14473 
14474  /* "View.MemoryView":624
14475  * cdef __Pyx_memviewslice tmp
14476  * mslice = get_slice_from_memview(self, &tmp)
14477  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14478  *
14479  * def copy(self):
14480  */
14481  __Pyx_XDECREF(__pyx_r);
14482  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 624, __pyx_L1_error)
14483  __Pyx_GOTREF(__pyx_t_1);
14484  __pyx_r = __pyx_t_1;
14485  __pyx_t_1 = 0;
14486  goto __pyx_L0;
14487 
14488  /* "View.MemoryView":620
14489  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14490  *
14491  * def is_f_contig(self): # <<<<<<<<<<<<<<
14492  * cdef __Pyx_memviewslice *mslice
14493  * cdef __Pyx_memviewslice tmp
14494  */
14495 
14496  /* function exit code */
14497  __pyx_L1_error:;
14498  __Pyx_XDECREF(__pyx_t_1);
14499  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14500  __pyx_r = NULL;
14501  __pyx_L0:;
14502  __Pyx_XGIVEREF(__pyx_r);
14503  __Pyx_RefNannyFinishContext();
14504  return __pyx_r;
14505 }
14506 
14507 /* "View.MemoryView":626
14508  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14509  *
14510  * def copy(self): # <<<<<<<<<<<<<<
14511  * cdef __Pyx_memviewslice mslice
14512  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14513  */
14514 
14515 /* Python wrapper */
14516 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14517 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14518  PyObject *__pyx_r = 0;
14519  __Pyx_RefNannyDeclarations
14520  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14521  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14522 
14523  /* function exit code */
14524  __Pyx_RefNannyFinishContext();
14525  return __pyx_r;
14526 }
14527 
14528 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14529  __Pyx_memviewslice __pyx_v_mslice;
14530  int __pyx_v_flags;
14531  PyObject *__pyx_r = NULL;
14532  __Pyx_RefNannyDeclarations
14533  __Pyx_memviewslice __pyx_t_1;
14534  PyObject *__pyx_t_2 = NULL;
14535  __Pyx_RefNannySetupContext("copy", 0);
14536 
14537  /* "View.MemoryView":628
14538  * def copy(self):
14539  * cdef __Pyx_memviewslice mslice
14540  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14541  *
14542  * slice_copy(self, &mslice)
14543  */
14544  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14545 
14546  /* "View.MemoryView":630
14547  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14548  *
14549  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14550  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14551  * self.view.itemsize,
14552  */
14553  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14554 
14555  /* "View.MemoryView":631
14556  *
14557  * slice_copy(self, &mslice)
14558  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14559  * self.view.itemsize,
14560  * flags|PyBUF_C_CONTIGUOUS,
14561  */
14562  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 631, __pyx_L1_error)
14563  __pyx_v_mslice = __pyx_t_1;
14564 
14565  /* "View.MemoryView":636
14566  * self.dtype_is_object)
14567  *
14568  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14569  *
14570  * def copy_fortran(self):
14571  */
14572  __Pyx_XDECREF(__pyx_r);
14573  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 636, __pyx_L1_error)
14574  __Pyx_GOTREF(__pyx_t_2);
14575  __pyx_r = __pyx_t_2;
14576  __pyx_t_2 = 0;
14577  goto __pyx_L0;
14578 
14579  /* "View.MemoryView":626
14580  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14581  *
14582  * def copy(self): # <<<<<<<<<<<<<<
14583  * cdef __Pyx_memviewslice mslice
14584  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14585  */
14586 
14587  /* function exit code */
14588  __pyx_L1_error:;
14589  __Pyx_XDECREF(__pyx_t_2);
14590  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14591  __pyx_r = NULL;
14592  __pyx_L0:;
14593  __Pyx_XGIVEREF(__pyx_r);
14594  __Pyx_RefNannyFinishContext();
14595  return __pyx_r;
14596 }
14597 
14598 /* "View.MemoryView":638
14599  * return memoryview_copy_from_slice(self, &mslice)
14600  *
14601  * def copy_fortran(self): # <<<<<<<<<<<<<<
14602  * cdef __Pyx_memviewslice src, dst
14603  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14604  */
14605 
14606 /* Python wrapper */
14607 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14608 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14609  PyObject *__pyx_r = 0;
14610  __Pyx_RefNannyDeclarations
14611  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14612  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14613 
14614  /* function exit code */
14615  __Pyx_RefNannyFinishContext();
14616  return __pyx_r;
14617 }
14618 
14619 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14620  __Pyx_memviewslice __pyx_v_src;
14621  __Pyx_memviewslice __pyx_v_dst;
14622  int __pyx_v_flags;
14623  PyObject *__pyx_r = NULL;
14624  __Pyx_RefNannyDeclarations
14625  __Pyx_memviewslice __pyx_t_1;
14626  PyObject *__pyx_t_2 = NULL;
14627  __Pyx_RefNannySetupContext("copy_fortran", 0);
14628 
14629  /* "View.MemoryView":640
14630  * def copy_fortran(self):
14631  * cdef __Pyx_memviewslice src, dst
14632  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14633  *
14634  * slice_copy(self, &src)
14635  */
14636  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14637 
14638  /* "View.MemoryView":642
14639  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14640  *
14641  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14642  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14643  * self.view.itemsize,
14644  */
14645  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14646 
14647  /* "View.MemoryView":643
14648  *
14649  * slice_copy(self, &src)
14650  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14651  * self.view.itemsize,
14652  * flags|PyBUF_F_CONTIGUOUS,
14653  */
14654  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 643, __pyx_L1_error)
14655  __pyx_v_dst = __pyx_t_1;
14656 
14657  /* "View.MemoryView":648
14658  * self.dtype_is_object)
14659  *
14660  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14661  *
14662  *
14663  */
14664  __Pyx_XDECREF(__pyx_r);
14665  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 648, __pyx_L1_error)
14666  __Pyx_GOTREF(__pyx_t_2);
14667  __pyx_r = __pyx_t_2;
14668  __pyx_t_2 = 0;
14669  goto __pyx_L0;
14670 
14671  /* "View.MemoryView":638
14672  * return memoryview_copy_from_slice(self, &mslice)
14673  *
14674  * def copy_fortran(self): # <<<<<<<<<<<<<<
14675  * cdef __Pyx_memviewslice src, dst
14676  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14677  */
14678 
14679  /* function exit code */
14680  __pyx_L1_error:;
14681  __Pyx_XDECREF(__pyx_t_2);
14682  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14683  __pyx_r = NULL;
14684  __pyx_L0:;
14685  __Pyx_XGIVEREF(__pyx_r);
14686  __Pyx_RefNannyFinishContext();
14687  return __pyx_r;
14688 }
14689 
14690 /* "(tree fragment)":1
14691  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14692  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14693  * def __setstate_cython__(self, __pyx_state):
14694  */
14695 
14696 /* Python wrapper */
14697 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14698 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14699  PyObject *__pyx_r = 0;
14700  __Pyx_RefNannyDeclarations
14701  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14702  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14703 
14704  /* function exit code */
14705  __Pyx_RefNannyFinishContext();
14706  return __pyx_r;
14707 }
14708 
14709 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14710  PyObject *__pyx_r = NULL;
14711  __Pyx_RefNannyDeclarations
14712  PyObject *__pyx_t_1 = NULL;
14713  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14714 
14715  /* "(tree fragment)":2
14716  * def __reduce_cython__(self):
14717  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14718  * def __setstate_cython__(self, __pyx_state):
14719  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14720  */
14721  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14722  __Pyx_GOTREF(__pyx_t_1);
14723  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14724  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14725  __PYX_ERR(1, 2, __pyx_L1_error)
14726 
14727  /* "(tree fragment)":1
14728  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14729  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14730  * def __setstate_cython__(self, __pyx_state):
14731  */
14732 
14733  /* function exit code */
14734  __pyx_L1_error:;
14735  __Pyx_XDECREF(__pyx_t_1);
14736  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14737  __pyx_r = NULL;
14738  __Pyx_XGIVEREF(__pyx_r);
14739  __Pyx_RefNannyFinishContext();
14740  return __pyx_r;
14741 }
14742 
14743 /* "(tree fragment)":3
14744  * def __reduce_cython__(self):
14745  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14746  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14747  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14748  */
14749 
14750 /* Python wrapper */
14751 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14752 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14753  PyObject *__pyx_r = 0;
14754  __Pyx_RefNannyDeclarations
14755  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14756  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14757 
14758  /* function exit code */
14759  __Pyx_RefNannyFinishContext();
14760  return __pyx_r;
14761 }
14762 
14763 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14764  PyObject *__pyx_r = NULL;
14765  __Pyx_RefNannyDeclarations
14766  PyObject *__pyx_t_1 = NULL;
14767  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14768 
14769  /* "(tree fragment)":4
14770  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14771  * def __setstate_cython__(self, __pyx_state):
14772  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14773  */
14774  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14775  __Pyx_GOTREF(__pyx_t_1);
14776  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14777  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14778  __PYX_ERR(1, 4, __pyx_L1_error)
14779 
14780  /* "(tree fragment)":3
14781  * def __reduce_cython__(self):
14782  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14783  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14784  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14785  */
14786 
14787  /* function exit code */
14788  __pyx_L1_error:;
14789  __Pyx_XDECREF(__pyx_t_1);
14790  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14791  __pyx_r = NULL;
14792  __Pyx_XGIVEREF(__pyx_r);
14793  __Pyx_RefNannyFinishContext();
14794  return __pyx_r;
14795 }
14796 
14797 /* "View.MemoryView":652
14798  *
14799  * @cname('__pyx_memoryview_new')
14800  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14801  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14802  * result.typeinfo = typeinfo
14803  */
14804 
14805 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14806  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14807  PyObject *__pyx_r = NULL;
14808  __Pyx_RefNannyDeclarations
14809  PyObject *__pyx_t_1 = NULL;
14810  PyObject *__pyx_t_2 = NULL;
14811  PyObject *__pyx_t_3 = NULL;
14812  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14813 
14814  /* "View.MemoryView":653
14815  * @cname('__pyx_memoryview_new')
14816  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14817  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14818  * result.typeinfo = typeinfo
14819  * return result
14820  */
14821  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 653, __pyx_L1_error)
14822  __Pyx_GOTREF(__pyx_t_1);
14823  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14824  __Pyx_GOTREF(__pyx_t_2);
14825  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error)
14826  __Pyx_GOTREF(__pyx_t_3);
14827  __Pyx_INCREF(__pyx_v_o);
14828  __Pyx_GIVEREF(__pyx_v_o);
14829  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14830  __Pyx_GIVEREF(__pyx_t_1);
14831  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14832  __Pyx_GIVEREF(__pyx_t_2);
14833  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14834  __pyx_t_1 = 0;
14835  __pyx_t_2 = 0;
14836  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14837  __Pyx_GOTREF(__pyx_t_2);
14838  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14839  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14840  __pyx_t_2 = 0;
14841 
14842  /* "View.MemoryView":654
14843  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14844  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14845  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14846  * return result
14847  *
14848  */
14849  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14850 
14851  /* "View.MemoryView":655
14852  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14853  * result.typeinfo = typeinfo
14854  * return result # <<<<<<<<<<<<<<
14855  *
14856  * @cname('__pyx_memoryview_check')
14857  */
14858  __Pyx_XDECREF(__pyx_r);
14859  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14860  __pyx_r = ((PyObject *)__pyx_v_result);
14861  goto __pyx_L0;
14862 
14863  /* "View.MemoryView":652
14864  *
14865  * @cname('__pyx_memoryview_new')
14866  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14867  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14868  * result.typeinfo = typeinfo
14869  */
14870 
14871  /* function exit code */
14872  __pyx_L1_error:;
14873  __Pyx_XDECREF(__pyx_t_1);
14874  __Pyx_XDECREF(__pyx_t_2);
14875  __Pyx_XDECREF(__pyx_t_3);
14876  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14877  __pyx_r = 0;
14878  __pyx_L0:;
14879  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14880  __Pyx_XGIVEREF(__pyx_r);
14881  __Pyx_RefNannyFinishContext();
14882  return __pyx_r;
14883 }
14884 
14885 /* "View.MemoryView":658
14886  *
14887  * @cname('__pyx_memoryview_check')
14888  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14889  * return isinstance(o, memoryview)
14890  *
14891  */
14892 
14893 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14894  int __pyx_r;
14895  __Pyx_RefNannyDeclarations
14896  int __pyx_t_1;
14897  __Pyx_RefNannySetupContext("memoryview_check", 0);
14898 
14899  /* "View.MemoryView":659
14900  * @cname('__pyx_memoryview_check')
14901  * cdef inline bint memoryview_check(object o):
14902  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14903  *
14904  * cdef tuple _unellipsify(object index, int ndim):
14905  */
14906  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14907  __pyx_r = __pyx_t_1;
14908  goto __pyx_L0;
14909 
14910  /* "View.MemoryView":658
14911  *
14912  * @cname('__pyx_memoryview_check')
14913  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14914  * return isinstance(o, memoryview)
14915  *
14916  */
14917 
14918  /* function exit code */
14919  __pyx_L0:;
14920  __Pyx_RefNannyFinishContext();
14921  return __pyx_r;
14922 }
14923 
14924 /* "View.MemoryView":661
14925  * return isinstance(o, memoryview)
14926  *
14927  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14928  * """
14929  * Replace all ellipses with full slices and fill incomplete indices with
14930  */
14931 
14932 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14933  PyObject *__pyx_v_tup = NULL;
14934  PyObject *__pyx_v_result = NULL;
14935  int __pyx_v_have_slices;
14936  int __pyx_v_seen_ellipsis;
14937  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14938  PyObject *__pyx_v_item = NULL;
14939  Py_ssize_t __pyx_v_nslices;
14940  PyObject *__pyx_r = NULL;
14941  __Pyx_RefNannyDeclarations
14942  int __pyx_t_1;
14943  int __pyx_t_2;
14944  PyObject *__pyx_t_3 = NULL;
14945  PyObject *__pyx_t_4 = NULL;
14946  Py_ssize_t __pyx_t_5;
14947  PyObject *(*__pyx_t_6)(PyObject *);
14948  PyObject *__pyx_t_7 = NULL;
14949  Py_ssize_t __pyx_t_8;
14950  int __pyx_t_9;
14951  int __pyx_t_10;
14952  PyObject *__pyx_t_11 = NULL;
14953  __Pyx_RefNannySetupContext("_unellipsify", 0);
14954 
14955  /* "View.MemoryView":666
14956  * full slices.
14957  * """
14958  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14959  * tup = (index,)
14960  * else:
14961  */
14962  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14963  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14964  if (__pyx_t_2) {
14965 
14966  /* "View.MemoryView":667
14967  * """
14968  * if not isinstance(index, tuple):
14969  * tup = (index,) # <<<<<<<<<<<<<<
14970  * else:
14971  * tup = index
14972  */
14973  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
14974  __Pyx_GOTREF(__pyx_t_3);
14975  __Pyx_INCREF(__pyx_v_index);
14976  __Pyx_GIVEREF(__pyx_v_index);
14977  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14978  __pyx_v_tup = __pyx_t_3;
14979  __pyx_t_3 = 0;
14980 
14981  /* "View.MemoryView":666
14982  * full slices.
14983  * """
14984  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14985  * tup = (index,)
14986  * else:
14987  */
14988  goto __pyx_L3;
14989  }
14990 
14991  /* "View.MemoryView":669
14992  * tup = (index,)
14993  * else:
14994  * tup = index # <<<<<<<<<<<<<<
14995  *
14996  * result = []
14997  */
14998  /*else*/ {
14999  __Pyx_INCREF(__pyx_v_index);
15000  __pyx_v_tup = __pyx_v_index;
15001  }
15002  __pyx_L3:;
15003 
15004  /* "View.MemoryView":671
15005  * tup = index
15006  *
15007  * result = [] # <<<<<<<<<<<<<<
15008  * have_slices = False
15009  * seen_ellipsis = False
15010  */
15011  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 671, __pyx_L1_error)
15012  __Pyx_GOTREF(__pyx_t_3);
15013  __pyx_v_result = ((PyObject*)__pyx_t_3);
15014  __pyx_t_3 = 0;
15015 
15016  /* "View.MemoryView":672
15017  *
15018  * result = []
15019  * have_slices = False # <<<<<<<<<<<<<<
15020  * seen_ellipsis = False
15021  * for idx, item in enumerate(tup):
15022  */
15023  __pyx_v_have_slices = 0;
15024 
15025  /* "View.MemoryView":673
15026  * result = []
15027  * have_slices = False
15028  * seen_ellipsis = False # <<<<<<<<<<<<<<
15029  * for idx, item in enumerate(tup):
15030  * if item is Ellipsis:
15031  */
15032  __pyx_v_seen_ellipsis = 0;
15033 
15034  /* "View.MemoryView":674
15035  * have_slices = False
15036  * seen_ellipsis = False
15037  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15038  * if item is Ellipsis:
15039  * if not seen_ellipsis:
15040  */
15041  __Pyx_INCREF(__pyx_int_0);
15042  __pyx_t_3 = __pyx_int_0;
15043  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15044  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15045  __pyx_t_6 = NULL;
15046  } else {
15047  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error)
15048  __Pyx_GOTREF(__pyx_t_4);
15049  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 674, __pyx_L1_error)
15050  }
15051  for (;;) {
15052  if (likely(!__pyx_t_6)) {
15053  if (likely(PyList_CheckExact(__pyx_t_4))) {
15054  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15055  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15056  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
15057  #else
15058  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15059  __Pyx_GOTREF(__pyx_t_7);
15060  #endif
15061  } else {
15062  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15063  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15064  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
15065  #else
15066  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15067  __Pyx_GOTREF(__pyx_t_7);
15068  #endif
15069  }
15070  } else {
15071  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15072  if (unlikely(!__pyx_t_7)) {
15073  PyObject* exc_type = PyErr_Occurred();
15074  if (exc_type) {
15075  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15076  else __PYX_ERR(1, 674, __pyx_L1_error)
15077  }
15078  break;
15079  }
15080  __Pyx_GOTREF(__pyx_t_7);
15081  }
15082  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15083  __pyx_t_7 = 0;
15084  __Pyx_INCREF(__pyx_t_3);
15085  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15086  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15087  __Pyx_GOTREF(__pyx_t_7);
15088  __Pyx_DECREF(__pyx_t_3);
15089  __pyx_t_3 = __pyx_t_7;
15090  __pyx_t_7 = 0;
15091 
15092  /* "View.MemoryView":675
15093  * seen_ellipsis = False
15094  * for idx, item in enumerate(tup):
15095  * if item is Ellipsis: # <<<<<<<<<<<<<<
15096  * if not seen_ellipsis:
15097  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15098  */
15099  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15100  __pyx_t_1 = (__pyx_t_2 != 0);
15101  if (__pyx_t_1) {
15102 
15103  /* "View.MemoryView":676
15104  * for idx, item in enumerate(tup):
15105  * if item is Ellipsis:
15106  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15107  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15108  * seen_ellipsis = True
15109  */
15110  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15111  if (__pyx_t_1) {
15112 
15113  /* "View.MemoryView":677
15114  * if item is Ellipsis:
15115  * if not seen_ellipsis:
15116  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15117  * seen_ellipsis = True
15118  * else:
15119  */
15120  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
15121  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 677, __pyx_L1_error)
15122  __Pyx_GOTREF(__pyx_t_7);
15123  { Py_ssize_t __pyx_temp;
15124  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15125  __Pyx_INCREF(__pyx_slice__30);
15126  __Pyx_GIVEREF(__pyx_slice__30);
15127  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__30);
15128  }
15129  }
15130  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
15131  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15132 
15133  /* "View.MemoryView":678
15134  * if not seen_ellipsis:
15135  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15136  * seen_ellipsis = True # <<<<<<<<<<<<<<
15137  * else:
15138  * result.append(slice(None))
15139  */
15140  __pyx_v_seen_ellipsis = 1;
15141 
15142  /* "View.MemoryView":676
15143  * for idx, item in enumerate(tup):
15144  * if item is Ellipsis:
15145  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15146  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15147  * seen_ellipsis = True
15148  */
15149  goto __pyx_L7;
15150  }
15151 
15152  /* "View.MemoryView":680
15153  * seen_ellipsis = True
15154  * else:
15155  * result.append(slice(None)) # <<<<<<<<<<<<<<
15156  * have_slices = True
15157  * else:
15158  */
15159  /*else*/ {
15160  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__31); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 680, __pyx_L1_error)
15161  }
15162  __pyx_L7:;
15163 
15164  /* "View.MemoryView":681
15165  * else:
15166  * result.append(slice(None))
15167  * have_slices = True # <<<<<<<<<<<<<<
15168  * else:
15169  * if not isinstance(item, slice) and not PyIndex_Check(item):
15170  */
15171  __pyx_v_have_slices = 1;
15172 
15173  /* "View.MemoryView":675
15174  * seen_ellipsis = False
15175  * for idx, item in enumerate(tup):
15176  * if item is Ellipsis: # <<<<<<<<<<<<<<
15177  * if not seen_ellipsis:
15178  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15179  */
15180  goto __pyx_L6;
15181  }
15182 
15183  /* "View.MemoryView":683
15184  * have_slices = True
15185  * else:
15186  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15187  * raise TypeError("Cannot index with type '%s'" % type(item))
15188  *
15189  */
15190  /*else*/ {
15191  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15192  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15193  if (__pyx_t_10) {
15194  } else {
15195  __pyx_t_1 = __pyx_t_10;
15196  goto __pyx_L9_bool_binop_done;
15197  }
15198  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15199  __pyx_t_1 = __pyx_t_10;
15200  __pyx_L9_bool_binop_done:;
15201  if (unlikely(__pyx_t_1)) {
15202 
15203  /* "View.MemoryView":684
15204  * else:
15205  * if not isinstance(item, slice) and not PyIndex_Check(item):
15206  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15207  *
15208  * have_slices = have_slices or isinstance(item, slice)
15209  */
15210  __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
15211  __Pyx_GOTREF(__pyx_t_7);
15212  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 684, __pyx_L1_error)
15213  __Pyx_GOTREF(__pyx_t_11);
15214  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15215  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15216  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15217  __PYX_ERR(1, 684, __pyx_L1_error)
15218 
15219  /* "View.MemoryView":683
15220  * have_slices = True
15221  * else:
15222  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15223  * raise TypeError("Cannot index with type '%s'" % type(item))
15224  *
15225  */
15226  }
15227 
15228  /* "View.MemoryView":686
15229  * raise TypeError("Cannot index with type '%s'" % type(item))
15230  *
15231  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15232  * result.append(item)
15233  *
15234  */
15235  __pyx_t_10 = (__pyx_v_have_slices != 0);
15236  if (!__pyx_t_10) {
15237  } else {
15238  __pyx_t_1 = __pyx_t_10;
15239  goto __pyx_L11_bool_binop_done;
15240  }
15241  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15242  __pyx_t_2 = (__pyx_t_10 != 0);
15243  __pyx_t_1 = __pyx_t_2;
15244  __pyx_L11_bool_binop_done:;
15245  __pyx_v_have_slices = __pyx_t_1;
15246 
15247  /* "View.MemoryView":687
15248  *
15249  * have_slices = have_slices or isinstance(item, slice)
15250  * result.append(item) # <<<<<<<<<<<<<<
15251  *
15252  * nslices = ndim - len(result)
15253  */
15254  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
15255  }
15256  __pyx_L6:;
15257 
15258  /* "View.MemoryView":674
15259  * have_slices = False
15260  * seen_ellipsis = False
15261  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15262  * if item is Ellipsis:
15263  * if not seen_ellipsis:
15264  */
15265  }
15266  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15267  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15268 
15269  /* "View.MemoryView":689
15270  * result.append(item)
15271  *
15272  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15273  * if nslices:
15274  * result.extend([slice(None)] * nslices)
15275  */
15276  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 689, __pyx_L1_error)
15277  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15278 
15279  /* "View.MemoryView":690
15280  *
15281  * nslices = ndim - len(result)
15282  * if nslices: # <<<<<<<<<<<<<<
15283  * result.extend([slice(None)] * nslices)
15284  *
15285  */
15286  __pyx_t_1 = (__pyx_v_nslices != 0);
15287  if (__pyx_t_1) {
15288 
15289  /* "View.MemoryView":691
15290  * nslices = ndim - len(result)
15291  * if nslices:
15292  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15293  *
15294  * return have_slices or nslices, tuple(result)
15295  */
15296  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 691, __pyx_L1_error)
15297  __Pyx_GOTREF(__pyx_t_3);
15298  { Py_ssize_t __pyx_temp;
15299  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15300  __Pyx_INCREF(__pyx_slice__32);
15301  __Pyx_GIVEREF(__pyx_slice__32);
15302  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
15303  }
15304  }
15305  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 691, __pyx_L1_error)
15306  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15307 
15308  /* "View.MemoryView":690
15309  *
15310  * nslices = ndim - len(result)
15311  * if nslices: # <<<<<<<<<<<<<<
15312  * result.extend([slice(None)] * nslices)
15313  *
15314  */
15315  }
15316 
15317  /* "View.MemoryView":693
15318  * result.extend([slice(None)] * nslices)
15319  *
15320  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15321  *
15322  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15323  */
15324  __Pyx_XDECREF(__pyx_r);
15325  if (!__pyx_v_have_slices) {
15326  } else {
15327  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15328  __Pyx_GOTREF(__pyx_t_4);
15329  __pyx_t_3 = __pyx_t_4;
15330  __pyx_t_4 = 0;
15331  goto __pyx_L14_bool_binop_done;
15332  }
15333  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15334  __Pyx_GOTREF(__pyx_t_4);
15335  __pyx_t_3 = __pyx_t_4;
15336  __pyx_t_4 = 0;
15337  __pyx_L14_bool_binop_done:;
15338  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15339  __Pyx_GOTREF(__pyx_t_4);
15340  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 693, __pyx_L1_error)
15341  __Pyx_GOTREF(__pyx_t_11);
15342  __Pyx_GIVEREF(__pyx_t_3);
15343  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15344  __Pyx_GIVEREF(__pyx_t_4);
15345  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15346  __pyx_t_3 = 0;
15347  __pyx_t_4 = 0;
15348  __pyx_r = ((PyObject*)__pyx_t_11);
15349  __pyx_t_11 = 0;
15350  goto __pyx_L0;
15351 
15352  /* "View.MemoryView":661
15353  * return isinstance(o, memoryview)
15354  *
15355  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15356  * """
15357  * Replace all ellipses with full slices and fill incomplete indices with
15358  */
15359 
15360  /* function exit code */
15361  __pyx_L1_error:;
15362  __Pyx_XDECREF(__pyx_t_3);
15363  __Pyx_XDECREF(__pyx_t_4);
15364  __Pyx_XDECREF(__pyx_t_7);
15365  __Pyx_XDECREF(__pyx_t_11);
15366  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15367  __pyx_r = 0;
15368  __pyx_L0:;
15369  __Pyx_XDECREF(__pyx_v_tup);
15370  __Pyx_XDECREF(__pyx_v_result);
15371  __Pyx_XDECREF(__pyx_v_idx);
15372  __Pyx_XDECREF(__pyx_v_item);
15373  __Pyx_XGIVEREF(__pyx_r);
15374  __Pyx_RefNannyFinishContext();
15375  return __pyx_r;
15376 }
15377 
15378 /* "View.MemoryView":695
15379  * return have_slices or nslices, tuple(result)
15380  *
15381  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15382  * for suboffset in suboffsets[:ndim]:
15383  * if suboffset >= 0:
15384  */
15385 
15386 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15387  Py_ssize_t __pyx_v_suboffset;
15388  PyObject *__pyx_r = NULL;
15389  __Pyx_RefNannyDeclarations
15390  Py_ssize_t *__pyx_t_1;
15391  Py_ssize_t *__pyx_t_2;
15392  Py_ssize_t *__pyx_t_3;
15393  int __pyx_t_4;
15394  PyObject *__pyx_t_5 = NULL;
15395  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15396 
15397  /* "View.MemoryView":696
15398  *
15399  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15400  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15401  * if suboffset >= 0:
15402  * raise ValueError("Indirect dimensions not supported")
15403  */
15404  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15405  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15406  __pyx_t_1 = __pyx_t_3;
15407  __pyx_v_suboffset = (__pyx_t_1[0]);
15408 
15409  /* "View.MemoryView":697
15410  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15411  * for suboffset in suboffsets[:ndim]:
15412  * if suboffset >= 0: # <<<<<<<<<<<<<<
15413  * raise ValueError("Indirect dimensions not supported")
15414  *
15415  */
15416  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15417  if (unlikely(__pyx_t_4)) {
15418 
15419  /* "View.MemoryView":698
15420  * for suboffset in suboffsets[:ndim]:
15421  * if suboffset >= 0:
15422  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15423  *
15424  *
15425  */
15426  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 698, __pyx_L1_error)
15427  __Pyx_GOTREF(__pyx_t_5);
15428  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15429  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15430  __PYX_ERR(1, 698, __pyx_L1_error)
15431 
15432  /* "View.MemoryView":697
15433  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15434  * for suboffset in suboffsets[:ndim]:
15435  * if suboffset >= 0: # <<<<<<<<<<<<<<
15436  * raise ValueError("Indirect dimensions not supported")
15437  *
15438  */
15439  }
15440  }
15441 
15442  /* "View.MemoryView":695
15443  * return have_slices or nslices, tuple(result)
15444  *
15445  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15446  * for suboffset in suboffsets[:ndim]:
15447  * if suboffset >= 0:
15448  */
15449 
15450  /* function exit code */
15451  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15452  goto __pyx_L0;
15453  __pyx_L1_error:;
15454  __Pyx_XDECREF(__pyx_t_5);
15455  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15456  __pyx_r = 0;
15457  __pyx_L0:;
15458  __Pyx_XGIVEREF(__pyx_r);
15459  __Pyx_RefNannyFinishContext();
15460  return __pyx_r;
15461 }
15462 
15463 /* "View.MemoryView":705
15464  *
15465  * @cname('__pyx_memview_slice')
15466  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15467  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15468  * cdef bint negative_step
15469  */
15470 
15471 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15472  int __pyx_v_new_ndim;
15473  int __pyx_v_suboffset_dim;
15474  int __pyx_v_dim;
15475  __Pyx_memviewslice __pyx_v_src;
15476  __Pyx_memviewslice __pyx_v_dst;
15477  __Pyx_memviewslice *__pyx_v_p_src;
15478  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15479  __Pyx_memviewslice *__pyx_v_p_dst;
15480  int *__pyx_v_p_suboffset_dim;
15481  Py_ssize_t __pyx_v_start;
15482  Py_ssize_t __pyx_v_stop;
15483  Py_ssize_t __pyx_v_step;
15484  int __pyx_v_have_start;
15485  int __pyx_v_have_stop;
15486  int __pyx_v_have_step;
15487  PyObject *__pyx_v_index = NULL;
15488  struct __pyx_memoryview_obj *__pyx_r = NULL;
15489  __Pyx_RefNannyDeclarations
15490  int __pyx_t_1;
15491  int __pyx_t_2;
15492  PyObject *__pyx_t_3 = NULL;
15493  struct __pyx_memoryview_obj *__pyx_t_4;
15494  char *__pyx_t_5;
15495  int __pyx_t_6;
15496  Py_ssize_t __pyx_t_7;
15497  PyObject *(*__pyx_t_8)(PyObject *);
15498  PyObject *__pyx_t_9 = NULL;
15499  Py_ssize_t __pyx_t_10;
15500  int __pyx_t_11;
15501  Py_ssize_t __pyx_t_12;
15502  __Pyx_RefNannySetupContext("memview_slice", 0);
15503 
15504  /* "View.MemoryView":706
15505  * @cname('__pyx_memview_slice')
15506  * cdef memoryview memview_slice(memoryview memview, object indices):
15507  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15508  * cdef bint negative_step
15509  * cdef __Pyx_memviewslice src, dst
15510  */
15511  __pyx_v_new_ndim = 0;
15512  __pyx_v_suboffset_dim = -1;
15513 
15514  /* "View.MemoryView":713
15515  *
15516  *
15517  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15518  *
15519  * cdef _memoryviewslice memviewsliceobj
15520  */
15521  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15522 
15523  /* "View.MemoryView":717
15524  * cdef _memoryviewslice memviewsliceobj
15525  *
15526  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15527  *
15528  * if isinstance(memview, _memoryviewslice):
15529  */
15530  #ifndef CYTHON_WITHOUT_ASSERTIONS
15531  if (unlikely(!Py_OptimizeFlag)) {
15532  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15533  PyErr_SetNone(PyExc_AssertionError);
15534  __PYX_ERR(1, 717, __pyx_L1_error)
15535  }
15536  }
15537  #endif
15538 
15539  /* "View.MemoryView":719
15540  * assert memview.view.ndim > 0
15541  *
15542  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15543  * memviewsliceobj = memview
15544  * p_src = &memviewsliceobj.from_slice
15545  */
15546  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15547  __pyx_t_2 = (__pyx_t_1 != 0);
15548  if (__pyx_t_2) {
15549 
15550  /* "View.MemoryView":720
15551  *
15552  * if isinstance(memview, _memoryviewslice):
15553  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15554  * p_src = &memviewsliceobj.from_slice
15555  * else:
15556  */
15557  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 720, __pyx_L1_error)
15558  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15559  __Pyx_INCREF(__pyx_t_3);
15560  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15561  __pyx_t_3 = 0;
15562 
15563  /* "View.MemoryView":721
15564  * if isinstance(memview, _memoryviewslice):
15565  * memviewsliceobj = memview
15566  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15567  * else:
15568  * slice_copy(memview, &src)
15569  */
15570  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15571 
15572  /* "View.MemoryView":719
15573  * assert memview.view.ndim > 0
15574  *
15575  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15576  * memviewsliceobj = memview
15577  * p_src = &memviewsliceobj.from_slice
15578  */
15579  goto __pyx_L3;
15580  }
15581 
15582  /* "View.MemoryView":723
15583  * p_src = &memviewsliceobj.from_slice
15584  * else:
15585  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15586  * p_src = &src
15587  *
15588  */
15589  /*else*/ {
15590  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15591 
15592  /* "View.MemoryView":724
15593  * else:
15594  * slice_copy(memview, &src)
15595  * p_src = &src # <<<<<<<<<<<<<<
15596  *
15597  *
15598  */
15599  __pyx_v_p_src = (&__pyx_v_src);
15600  }
15601  __pyx_L3:;
15602 
15603  /* "View.MemoryView":730
15604  *
15605  *
15606  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15607  * dst.data = p_src.data
15608  *
15609  */
15610  __pyx_t_4 = __pyx_v_p_src->memview;
15611  __pyx_v_dst.memview = __pyx_t_4;
15612 
15613  /* "View.MemoryView":731
15614  *
15615  * dst.memview = p_src.memview
15616  * dst.data = p_src.data # <<<<<<<<<<<<<<
15617  *
15618  *
15619  */
15620  __pyx_t_5 = __pyx_v_p_src->data;
15621  __pyx_v_dst.data = __pyx_t_5;
15622 
15623  /* "View.MemoryView":736
15624  *
15625  *
15626  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15627  * cdef int *p_suboffset_dim = &suboffset_dim
15628  * cdef Py_ssize_t start, stop, step
15629  */
15630  __pyx_v_p_dst = (&__pyx_v_dst);
15631 
15632  /* "View.MemoryView":737
15633  *
15634  * cdef __Pyx_memviewslice *p_dst = &dst
15635  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15636  * cdef Py_ssize_t start, stop, step
15637  * cdef bint have_start, have_stop, have_step
15638  */
15639  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15640 
15641  /* "View.MemoryView":741
15642  * cdef bint have_start, have_stop, have_step
15643  *
15644  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15645  * if PyIndex_Check(index):
15646  * slice_memviewslice(
15647  */
15648  __pyx_t_6 = 0;
15649  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15650  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15651  __pyx_t_8 = NULL;
15652  } else {
15653  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 741, __pyx_L1_error)
15654  __Pyx_GOTREF(__pyx_t_3);
15655  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 741, __pyx_L1_error)
15656  }
15657  for (;;) {
15658  if (likely(!__pyx_t_8)) {
15659  if (likely(PyList_CheckExact(__pyx_t_3))) {
15660  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15661  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15662  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
15663  #else
15664  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
15665  __Pyx_GOTREF(__pyx_t_9);
15666  #endif
15667  } else {
15668  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15669  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15670  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
15671  #else
15672  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
15673  __Pyx_GOTREF(__pyx_t_9);
15674  #endif
15675  }
15676  } else {
15677  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15678  if (unlikely(!__pyx_t_9)) {
15679  PyObject* exc_type = PyErr_Occurred();
15680  if (exc_type) {
15681  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15682  else __PYX_ERR(1, 741, __pyx_L1_error)
15683  }
15684  break;
15685  }
15686  __Pyx_GOTREF(__pyx_t_9);
15687  }
15688  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15689  __pyx_t_9 = 0;
15690  __pyx_v_dim = __pyx_t_6;
15691  __pyx_t_6 = (__pyx_t_6 + 1);
15692 
15693  /* "View.MemoryView":742
15694  *
15695  * for dim, index in enumerate(indices):
15696  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15697  * slice_memviewslice(
15698  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15699  */
15700  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15701  if (__pyx_t_2) {
15702 
15703  /* "View.MemoryView":746
15704  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15705  * dim, new_ndim, p_suboffset_dim,
15706  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15707  * 0, 0, 0, # have_{start,stop,step}
15708  * False)
15709  */
15710  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
15711 
15712  /* "View.MemoryView":743
15713  * for dim, index in enumerate(indices):
15714  * if PyIndex_Check(index):
15715  * slice_memviewslice( # <<<<<<<<<<<<<<
15716  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15717  * dim, new_ndim, p_suboffset_dim,
15718  */
15719  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 743, __pyx_L1_error)
15720 
15721  /* "View.MemoryView":742
15722  *
15723  * for dim, index in enumerate(indices):
15724  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15725  * slice_memviewslice(
15726  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15727  */
15728  goto __pyx_L6;
15729  }
15730 
15731  /* "View.MemoryView":749
15732  * 0, 0, 0, # have_{start,stop,step}
15733  * False)
15734  * elif index is None: # <<<<<<<<<<<<<<
15735  * p_dst.shape[new_ndim] = 1
15736  * p_dst.strides[new_ndim] = 0
15737  */
15738  __pyx_t_2 = (__pyx_v_index == Py_None);
15739  __pyx_t_1 = (__pyx_t_2 != 0);
15740  if (__pyx_t_1) {
15741 
15742  /* "View.MemoryView":750
15743  * False)
15744  * elif index is None:
15745  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15746  * p_dst.strides[new_ndim] = 0
15747  * p_dst.suboffsets[new_ndim] = -1
15748  */
15749  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15750 
15751  /* "View.MemoryView":751
15752  * elif index is None:
15753  * p_dst.shape[new_ndim] = 1
15754  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15755  * p_dst.suboffsets[new_ndim] = -1
15756  * new_ndim += 1
15757  */
15758  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15759 
15760  /* "View.MemoryView":752
15761  * p_dst.shape[new_ndim] = 1
15762  * p_dst.strides[new_ndim] = 0
15763  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15764  * new_ndim += 1
15765  * else:
15766  */
15767  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15768 
15769  /* "View.MemoryView":753
15770  * p_dst.strides[new_ndim] = 0
15771  * p_dst.suboffsets[new_ndim] = -1
15772  * new_ndim += 1 # <<<<<<<<<<<<<<
15773  * else:
15774  * start = index.start or 0
15775  */
15776  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15777 
15778  /* "View.MemoryView":749
15779  * 0, 0, 0, # have_{start,stop,step}
15780  * False)
15781  * elif index is None: # <<<<<<<<<<<<<<
15782  * p_dst.shape[new_ndim] = 1
15783  * p_dst.strides[new_ndim] = 0
15784  */
15785  goto __pyx_L6;
15786  }
15787 
15788  /* "View.MemoryView":755
15789  * new_ndim += 1
15790  * else:
15791  * start = index.start or 0 # <<<<<<<<<<<<<<
15792  * stop = index.stop or 0
15793  * step = index.step or 0
15794  */
15795  /*else*/ {
15796  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 755, __pyx_L1_error)
15797  __Pyx_GOTREF(__pyx_t_9);
15798  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 755, __pyx_L1_error)
15799  if (!__pyx_t_1) {
15800  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15801  } else {
15802  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 755, __pyx_L1_error)
15803  __pyx_t_10 = __pyx_t_12;
15804  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15805  goto __pyx_L7_bool_binop_done;
15806  }
15807  __pyx_t_10 = 0;
15808  __pyx_L7_bool_binop_done:;
15809  __pyx_v_start = __pyx_t_10;
15810 
15811  /* "View.MemoryView":756
15812  * else:
15813  * start = index.start or 0
15814  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15815  * step = index.step or 0
15816  *
15817  */
15818  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
15819  __Pyx_GOTREF(__pyx_t_9);
15820  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
15821  if (!__pyx_t_1) {
15822  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15823  } else {
15824  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
15825  __pyx_t_10 = __pyx_t_12;
15826  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15827  goto __pyx_L9_bool_binop_done;
15828  }
15829  __pyx_t_10 = 0;
15830  __pyx_L9_bool_binop_done:;
15831  __pyx_v_stop = __pyx_t_10;
15832 
15833  /* "View.MemoryView":757
15834  * start = index.start or 0
15835  * stop = index.stop or 0
15836  * step = index.step or 0 # <<<<<<<<<<<<<<
15837  *
15838  * have_start = index.start is not None
15839  */
15840  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
15841  __Pyx_GOTREF(__pyx_t_9);
15842  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
15843  if (!__pyx_t_1) {
15844  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15845  } else {
15846  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
15847  __pyx_t_10 = __pyx_t_12;
15848  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15849  goto __pyx_L11_bool_binop_done;
15850  }
15851  __pyx_t_10 = 0;
15852  __pyx_L11_bool_binop_done:;
15853  __pyx_v_step = __pyx_t_10;
15854 
15855  /* "View.MemoryView":759
15856  * step = index.step or 0
15857  *
15858  * have_start = index.start is not None # <<<<<<<<<<<<<<
15859  * have_stop = index.stop is not None
15860  * have_step = index.step is not None
15861  */
15862  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 759, __pyx_L1_error)
15863  __Pyx_GOTREF(__pyx_t_9);
15864  __pyx_t_1 = (__pyx_t_9 != Py_None);
15865  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15866  __pyx_v_have_start = __pyx_t_1;
15867 
15868  /* "View.MemoryView":760
15869  *
15870  * have_start = index.start is not None
15871  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15872  * have_step = index.step is not None
15873  *
15874  */
15875  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15876  __Pyx_GOTREF(__pyx_t_9);
15877  __pyx_t_1 = (__pyx_t_9 != Py_None);
15878  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15879  __pyx_v_have_stop = __pyx_t_1;
15880 
15881  /* "View.MemoryView":761
15882  * have_start = index.start is not None
15883  * have_stop = index.stop is not None
15884  * have_step = index.step is not None # <<<<<<<<<<<<<<
15885  *
15886  * slice_memviewslice(
15887  */
15888  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15889  __Pyx_GOTREF(__pyx_t_9);
15890  __pyx_t_1 = (__pyx_t_9 != Py_None);
15891  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15892  __pyx_v_have_step = __pyx_t_1;
15893 
15894  /* "View.MemoryView":763
15895  * have_step = index.step is not None
15896  *
15897  * slice_memviewslice( # <<<<<<<<<<<<<<
15898  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15899  * dim, new_ndim, p_suboffset_dim,
15900  */
15901  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 763, __pyx_L1_error)
15902 
15903  /* "View.MemoryView":769
15904  * have_start, have_stop, have_step,
15905  * True)
15906  * new_ndim += 1 # <<<<<<<<<<<<<<
15907  *
15908  * if isinstance(memview, _memoryviewslice):
15909  */
15910  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15911  }
15912  __pyx_L6:;
15913 
15914  /* "View.MemoryView":741
15915  * cdef bint have_start, have_stop, have_step
15916  *
15917  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15918  * if PyIndex_Check(index):
15919  * slice_memviewslice(
15920  */
15921  }
15922  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15923 
15924  /* "View.MemoryView":771
15925  * new_ndim += 1
15926  *
15927  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15928  * return memoryview_fromslice(dst, new_ndim,
15929  * memviewsliceobj.to_object_func,
15930  */
15931  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15932  __pyx_t_2 = (__pyx_t_1 != 0);
15933  if (__pyx_t_2) {
15934 
15935  /* "View.MemoryView":772
15936  *
15937  * if isinstance(memview, _memoryviewslice):
15938  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15939  * memviewsliceobj.to_object_func,
15940  * memviewsliceobj.to_dtype_func,
15941  */
15942  __Pyx_XDECREF(((PyObject *)__pyx_r));
15943 
15944  /* "View.MemoryView":773
15945  * if isinstance(memview, _memoryviewslice):
15946  * return memoryview_fromslice(dst, new_ndim,
15947  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15948  * memviewsliceobj.to_dtype_func,
15949  * memview.dtype_is_object)
15950  */
15951  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 773, __pyx_L1_error) }
15952 
15953  /* "View.MemoryView":774
15954  * return memoryview_fromslice(dst, new_ndim,
15955  * memviewsliceobj.to_object_func,
15956  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15957  * memview.dtype_is_object)
15958  * else:
15959  */
15960  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
15961 
15962  /* "View.MemoryView":772
15963  *
15964  * if isinstance(memview, _memoryviewslice):
15965  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15966  * memviewsliceobj.to_object_func,
15967  * memviewsliceobj.to_dtype_func,
15968  */
15969  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error)
15970  __Pyx_GOTREF(__pyx_t_3);
15971  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 772, __pyx_L1_error)
15972  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15973  __pyx_t_3 = 0;
15974  goto __pyx_L0;
15975 
15976  /* "View.MemoryView":771
15977  * new_ndim += 1
15978  *
15979  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15980  * return memoryview_fromslice(dst, new_ndim,
15981  * memviewsliceobj.to_object_func,
15982  */
15983  }
15984 
15985  /* "View.MemoryView":777
15986  * memview.dtype_is_object)
15987  * else:
15988  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15989  * memview.dtype_is_object)
15990  *
15991  */
15992  /*else*/ {
15993  __Pyx_XDECREF(((PyObject *)__pyx_r));
15994 
15995  /* "View.MemoryView":778
15996  * else:
15997  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15998  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15999  *
16000  *
16001  */
16002  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16003  __Pyx_GOTREF(__pyx_t_3);
16004 
16005  /* "View.MemoryView":777
16006  * memview.dtype_is_object)
16007  * else:
16008  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16009  * memview.dtype_is_object)
16010  *
16011  */
16012  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16013  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16014  __pyx_t_3 = 0;
16015  goto __pyx_L0;
16016  }
16017 
16018  /* "View.MemoryView":705
16019  *
16020  * @cname('__pyx_memview_slice')
16021  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16022  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16023  * cdef bint negative_step
16024  */
16025 
16026  /* function exit code */
16027  __pyx_L1_error:;
16028  __Pyx_XDECREF(__pyx_t_3);
16029  __Pyx_XDECREF(__pyx_t_9);
16030  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16031  __pyx_r = 0;
16032  __pyx_L0:;
16033  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16034  __Pyx_XDECREF(__pyx_v_index);
16035  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16036  __Pyx_RefNannyFinishContext();
16037  return __pyx_r;
16038 }
16039 
16040 /* "View.MemoryView":802
16041  *
16042  * @cname('__pyx_memoryview_slice_memviewslice')
16043  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16044  * __Pyx_memviewslice *dst,
16045  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16046  */
16047 
16048 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16049  Py_ssize_t __pyx_v_new_shape;
16050  int __pyx_v_negative_step;
16051  int __pyx_r;
16052  int __pyx_t_1;
16053  int __pyx_t_2;
16054  int __pyx_t_3;
16055 
16056  /* "View.MemoryView":822
16057  * cdef bint negative_step
16058  *
16059  * if not is_slice: # <<<<<<<<<<<<<<
16060  *
16061  * if start < 0:
16062  */
16063  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16064  if (__pyx_t_1) {
16065 
16066  /* "View.MemoryView":824
16067  * if not is_slice:
16068  *
16069  * if start < 0: # <<<<<<<<<<<<<<
16070  * start += shape
16071  * if not 0 <= start < shape:
16072  */
16073  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16074  if (__pyx_t_1) {
16075 
16076  /* "View.MemoryView":825
16077  *
16078  * if start < 0:
16079  * start += shape # <<<<<<<<<<<<<<
16080  * if not 0 <= start < shape:
16081  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16082  */
16083  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16084 
16085  /* "View.MemoryView":824
16086  * if not is_slice:
16087  *
16088  * if start < 0: # <<<<<<<<<<<<<<
16089  * start += shape
16090  * if not 0 <= start < shape:
16091  */
16092  }
16093 
16094  /* "View.MemoryView":826
16095  * if start < 0:
16096  * start += shape
16097  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16098  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16099  * else:
16100  */
16101  __pyx_t_1 = (0 <= __pyx_v_start);
16102  if (__pyx_t_1) {
16103  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16104  }
16105  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16106  if (__pyx_t_2) {
16107 
16108  /* "View.MemoryView":827
16109  * start += shape
16110  * if not 0 <= start < shape:
16111  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16112  * else:
16113  *
16114  */
16115  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 827, __pyx_L1_error)
16116 
16117  /* "View.MemoryView":826
16118  * if start < 0:
16119  * start += shape
16120  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16121  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16122  * else:
16123  */
16124  }
16125 
16126  /* "View.MemoryView":822
16127  * cdef bint negative_step
16128  *
16129  * if not is_slice: # <<<<<<<<<<<<<<
16130  *
16131  * if start < 0:
16132  */
16133  goto __pyx_L3;
16134  }
16135 
16136  /* "View.MemoryView":830
16137  * else:
16138  *
16139  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16140  *
16141  * if have_step and step == 0:
16142  */
16143  /*else*/ {
16144  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16145  if (__pyx_t_1) {
16146  } else {
16147  __pyx_t_2 = __pyx_t_1;
16148  goto __pyx_L6_bool_binop_done;
16149  }
16150  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16151  __pyx_t_2 = __pyx_t_1;
16152  __pyx_L6_bool_binop_done:;
16153  __pyx_v_negative_step = __pyx_t_2;
16154 
16155  /* "View.MemoryView":832
16156  * negative_step = have_step != 0 and step < 0
16157  *
16158  * if have_step and step == 0: # <<<<<<<<<<<<<<
16159  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16160  *
16161  */
16162  __pyx_t_1 = (__pyx_v_have_step != 0);
16163  if (__pyx_t_1) {
16164  } else {
16165  __pyx_t_2 = __pyx_t_1;
16166  goto __pyx_L9_bool_binop_done;
16167  }
16168  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16169  __pyx_t_2 = __pyx_t_1;
16170  __pyx_L9_bool_binop_done:;
16171  if (__pyx_t_2) {
16172 
16173  /* "View.MemoryView":833
16174  *
16175  * if have_step and step == 0:
16176  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16177  *
16178  *
16179  */
16180  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 833, __pyx_L1_error)
16181 
16182  /* "View.MemoryView":832
16183  * negative_step = have_step != 0 and step < 0
16184  *
16185  * if have_step and step == 0: # <<<<<<<<<<<<<<
16186  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16187  *
16188  */
16189  }
16190 
16191  /* "View.MemoryView":836
16192  *
16193  *
16194  * if have_start: # <<<<<<<<<<<<<<
16195  * if start < 0:
16196  * start += shape
16197  */
16198  __pyx_t_2 = (__pyx_v_have_start != 0);
16199  if (__pyx_t_2) {
16200 
16201  /* "View.MemoryView":837
16202  *
16203  * if have_start:
16204  * if start < 0: # <<<<<<<<<<<<<<
16205  * start += shape
16206  * if start < 0:
16207  */
16208  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16209  if (__pyx_t_2) {
16210 
16211  /* "View.MemoryView":838
16212  * if have_start:
16213  * if start < 0:
16214  * start += shape # <<<<<<<<<<<<<<
16215  * if start < 0:
16216  * start = 0
16217  */
16218  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16219 
16220  /* "View.MemoryView":839
16221  * if start < 0:
16222  * start += shape
16223  * if start < 0: # <<<<<<<<<<<<<<
16224  * start = 0
16225  * elif start >= shape:
16226  */
16227  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16228  if (__pyx_t_2) {
16229 
16230  /* "View.MemoryView":840
16231  * start += shape
16232  * if start < 0:
16233  * start = 0 # <<<<<<<<<<<<<<
16234  * elif start >= shape:
16235  * if negative_step:
16236  */
16237  __pyx_v_start = 0;
16238 
16239  /* "View.MemoryView":839
16240  * if start < 0:
16241  * start += shape
16242  * if start < 0: # <<<<<<<<<<<<<<
16243  * start = 0
16244  * elif start >= shape:
16245  */
16246  }
16247 
16248  /* "View.MemoryView":837
16249  *
16250  * if have_start:
16251  * if start < 0: # <<<<<<<<<<<<<<
16252  * start += shape
16253  * if start < 0:
16254  */
16255  goto __pyx_L12;
16256  }
16257 
16258  /* "View.MemoryView":841
16259  * if start < 0:
16260  * start = 0
16261  * elif start >= shape: # <<<<<<<<<<<<<<
16262  * if negative_step:
16263  * start = shape - 1
16264  */
16265  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16266  if (__pyx_t_2) {
16267 
16268  /* "View.MemoryView":842
16269  * start = 0
16270  * elif start >= shape:
16271  * if negative_step: # <<<<<<<<<<<<<<
16272  * start = shape - 1
16273  * else:
16274  */
16275  __pyx_t_2 = (__pyx_v_negative_step != 0);
16276  if (__pyx_t_2) {
16277 
16278  /* "View.MemoryView":843
16279  * elif start >= shape:
16280  * if negative_step:
16281  * start = shape - 1 # <<<<<<<<<<<<<<
16282  * else:
16283  * start = shape
16284  */
16285  __pyx_v_start = (__pyx_v_shape - 1);
16286 
16287  /* "View.MemoryView":842
16288  * start = 0
16289  * elif start >= shape:
16290  * if negative_step: # <<<<<<<<<<<<<<
16291  * start = shape - 1
16292  * else:
16293  */
16294  goto __pyx_L14;
16295  }
16296 
16297  /* "View.MemoryView":845
16298  * start = shape - 1
16299  * else:
16300  * start = shape # <<<<<<<<<<<<<<
16301  * else:
16302  * if negative_step:
16303  */
16304  /*else*/ {
16305  __pyx_v_start = __pyx_v_shape;
16306  }
16307  __pyx_L14:;
16308 
16309  /* "View.MemoryView":841
16310  * if start < 0:
16311  * start = 0
16312  * elif start >= shape: # <<<<<<<<<<<<<<
16313  * if negative_step:
16314  * start = shape - 1
16315  */
16316  }
16317  __pyx_L12:;
16318 
16319  /* "View.MemoryView":836
16320  *
16321  *
16322  * if have_start: # <<<<<<<<<<<<<<
16323  * if start < 0:
16324  * start += shape
16325  */
16326  goto __pyx_L11;
16327  }
16328 
16329  /* "View.MemoryView":847
16330  * start = shape
16331  * else:
16332  * if negative_step: # <<<<<<<<<<<<<<
16333  * start = shape - 1
16334  * else:
16335  */
16336  /*else*/ {
16337  __pyx_t_2 = (__pyx_v_negative_step != 0);
16338  if (__pyx_t_2) {
16339 
16340  /* "View.MemoryView":848
16341  * else:
16342  * if negative_step:
16343  * start = shape - 1 # <<<<<<<<<<<<<<
16344  * else:
16345  * start = 0
16346  */
16347  __pyx_v_start = (__pyx_v_shape - 1);
16348 
16349  /* "View.MemoryView":847
16350  * start = shape
16351  * else:
16352  * if negative_step: # <<<<<<<<<<<<<<
16353  * start = shape - 1
16354  * else:
16355  */
16356  goto __pyx_L15;
16357  }
16358 
16359  /* "View.MemoryView":850
16360  * start = shape - 1
16361  * else:
16362  * start = 0 # <<<<<<<<<<<<<<
16363  *
16364  * if have_stop:
16365  */
16366  /*else*/ {
16367  __pyx_v_start = 0;
16368  }
16369  __pyx_L15:;
16370  }
16371  __pyx_L11:;
16372 
16373  /* "View.MemoryView":852
16374  * start = 0
16375  *
16376  * if have_stop: # <<<<<<<<<<<<<<
16377  * if stop < 0:
16378  * stop += shape
16379  */
16380  __pyx_t_2 = (__pyx_v_have_stop != 0);
16381  if (__pyx_t_2) {
16382 
16383  /* "View.MemoryView":853
16384  *
16385  * if have_stop:
16386  * if stop < 0: # <<<<<<<<<<<<<<
16387  * stop += shape
16388  * if stop < 0:
16389  */
16390  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16391  if (__pyx_t_2) {
16392 
16393  /* "View.MemoryView":854
16394  * if have_stop:
16395  * if stop < 0:
16396  * stop += shape # <<<<<<<<<<<<<<
16397  * if stop < 0:
16398  * stop = 0
16399  */
16400  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16401 
16402  /* "View.MemoryView":855
16403  * if stop < 0:
16404  * stop += shape
16405  * if stop < 0: # <<<<<<<<<<<<<<
16406  * stop = 0
16407  * elif stop > shape:
16408  */
16409  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16410  if (__pyx_t_2) {
16411 
16412  /* "View.MemoryView":856
16413  * stop += shape
16414  * if stop < 0:
16415  * stop = 0 # <<<<<<<<<<<<<<
16416  * elif stop > shape:
16417  * stop = shape
16418  */
16419  __pyx_v_stop = 0;
16420 
16421  /* "View.MemoryView":855
16422  * if stop < 0:
16423  * stop += shape
16424  * if stop < 0: # <<<<<<<<<<<<<<
16425  * stop = 0
16426  * elif stop > shape:
16427  */
16428  }
16429 
16430  /* "View.MemoryView":853
16431  *
16432  * if have_stop:
16433  * if stop < 0: # <<<<<<<<<<<<<<
16434  * stop += shape
16435  * if stop < 0:
16436  */
16437  goto __pyx_L17;
16438  }
16439 
16440  /* "View.MemoryView":857
16441  * if stop < 0:
16442  * stop = 0
16443  * elif stop > shape: # <<<<<<<<<<<<<<
16444  * stop = shape
16445  * else:
16446  */
16447  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16448  if (__pyx_t_2) {
16449 
16450  /* "View.MemoryView":858
16451  * stop = 0
16452  * elif stop > shape:
16453  * stop = shape # <<<<<<<<<<<<<<
16454  * else:
16455  * if negative_step:
16456  */
16457  __pyx_v_stop = __pyx_v_shape;
16458 
16459  /* "View.MemoryView":857
16460  * if stop < 0:
16461  * stop = 0
16462  * elif stop > shape: # <<<<<<<<<<<<<<
16463  * stop = shape
16464  * else:
16465  */
16466  }
16467  __pyx_L17:;
16468 
16469  /* "View.MemoryView":852
16470  * start = 0
16471  *
16472  * if have_stop: # <<<<<<<<<<<<<<
16473  * if stop < 0:
16474  * stop += shape
16475  */
16476  goto __pyx_L16;
16477  }
16478 
16479  /* "View.MemoryView":860
16480  * stop = shape
16481  * else:
16482  * if negative_step: # <<<<<<<<<<<<<<
16483  * stop = -1
16484  * else:
16485  */
16486  /*else*/ {
16487  __pyx_t_2 = (__pyx_v_negative_step != 0);
16488  if (__pyx_t_2) {
16489 
16490  /* "View.MemoryView":861
16491  * else:
16492  * if negative_step:
16493  * stop = -1 # <<<<<<<<<<<<<<
16494  * else:
16495  * stop = shape
16496  */
16497  __pyx_v_stop = -1L;
16498 
16499  /* "View.MemoryView":860
16500  * stop = shape
16501  * else:
16502  * if negative_step: # <<<<<<<<<<<<<<
16503  * stop = -1
16504  * else:
16505  */
16506  goto __pyx_L19;
16507  }
16508 
16509  /* "View.MemoryView":863
16510  * stop = -1
16511  * else:
16512  * stop = shape # <<<<<<<<<<<<<<
16513  *
16514  * if not have_step:
16515  */
16516  /*else*/ {
16517  __pyx_v_stop = __pyx_v_shape;
16518  }
16519  __pyx_L19:;
16520  }
16521  __pyx_L16:;
16522 
16523  /* "View.MemoryView":865
16524  * stop = shape
16525  *
16526  * if not have_step: # <<<<<<<<<<<<<<
16527  * step = 1
16528  *
16529  */
16530  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16531  if (__pyx_t_2) {
16532 
16533  /* "View.MemoryView":866
16534  *
16535  * if not have_step:
16536  * step = 1 # <<<<<<<<<<<<<<
16537  *
16538  *
16539  */
16540  __pyx_v_step = 1;
16541 
16542  /* "View.MemoryView":865
16543  * stop = shape
16544  *
16545  * if not have_step: # <<<<<<<<<<<<<<
16546  * step = 1
16547  *
16548  */
16549  }
16550 
16551  /* "View.MemoryView":870
16552  *
16553  * with cython.cdivision(True):
16554  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16555  *
16556  * if (stop - start) - step * new_shape:
16557  */
16558  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16559 
16560  /* "View.MemoryView":872
16561  * new_shape = (stop - start) // step
16562  *
16563  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16564  * new_shape += 1
16565  *
16566  */
16567  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16568  if (__pyx_t_2) {
16569 
16570  /* "View.MemoryView":873
16571  *
16572  * if (stop - start) - step * new_shape:
16573  * new_shape += 1 # <<<<<<<<<<<<<<
16574  *
16575  * if new_shape < 0:
16576  */
16577  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16578 
16579  /* "View.MemoryView":872
16580  * new_shape = (stop - start) // step
16581  *
16582  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16583  * new_shape += 1
16584  *
16585  */
16586  }
16587 
16588  /* "View.MemoryView":875
16589  * new_shape += 1
16590  *
16591  * if new_shape < 0: # <<<<<<<<<<<<<<
16592  * new_shape = 0
16593  *
16594  */
16595  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16596  if (__pyx_t_2) {
16597 
16598  /* "View.MemoryView":876
16599  *
16600  * if new_shape < 0:
16601  * new_shape = 0 # <<<<<<<<<<<<<<
16602  *
16603  *
16604  */
16605  __pyx_v_new_shape = 0;
16606 
16607  /* "View.MemoryView":875
16608  * new_shape += 1
16609  *
16610  * if new_shape < 0: # <<<<<<<<<<<<<<
16611  * new_shape = 0
16612  *
16613  */
16614  }
16615 
16616  /* "View.MemoryView":879
16617  *
16618  *
16619  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16620  * dst.shape[new_ndim] = new_shape
16621  * dst.suboffsets[new_ndim] = suboffset
16622  */
16623  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16624 
16625  /* "View.MemoryView":880
16626  *
16627  * dst.strides[new_ndim] = stride * step
16628  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16629  * dst.suboffsets[new_ndim] = suboffset
16630  *
16631  */
16632  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16633 
16634  /* "View.MemoryView":881
16635  * dst.strides[new_ndim] = stride * step
16636  * dst.shape[new_ndim] = new_shape
16637  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16638  *
16639  *
16640  */
16641  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16642  }
16643  __pyx_L3:;
16644 
16645  /* "View.MemoryView":884
16646  *
16647  *
16648  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16649  * dst.data += start * stride
16650  * else:
16651  */
16652  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16653  if (__pyx_t_2) {
16654 
16655  /* "View.MemoryView":885
16656  *
16657  * if suboffset_dim[0] < 0:
16658  * dst.data += start * stride # <<<<<<<<<<<<<<
16659  * else:
16660  * dst.suboffsets[suboffset_dim[0]] += start * stride
16661  */
16662  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16663 
16664  /* "View.MemoryView":884
16665  *
16666  *
16667  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16668  * dst.data += start * stride
16669  * else:
16670  */
16671  goto __pyx_L23;
16672  }
16673 
16674  /* "View.MemoryView":887
16675  * dst.data += start * stride
16676  * else:
16677  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16678  *
16679  * if suboffset >= 0:
16680  */
16681  /*else*/ {
16682  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16683  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16684  }
16685  __pyx_L23:;
16686 
16687  /* "View.MemoryView":889
16688  * dst.suboffsets[suboffset_dim[0]] += start * stride
16689  *
16690  * if suboffset >= 0: # <<<<<<<<<<<<<<
16691  * if not is_slice:
16692  * if new_ndim == 0:
16693  */
16694  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16695  if (__pyx_t_2) {
16696 
16697  /* "View.MemoryView":890
16698  *
16699  * if suboffset >= 0:
16700  * if not is_slice: # <<<<<<<<<<<<<<
16701  * if new_ndim == 0:
16702  * dst.data = (<char **> dst.data)[0] + suboffset
16703  */
16704  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16705  if (__pyx_t_2) {
16706 
16707  /* "View.MemoryView":891
16708  * if suboffset >= 0:
16709  * if not is_slice:
16710  * if new_ndim == 0: # <<<<<<<<<<<<<<
16711  * dst.data = (<char **> dst.data)[0] + suboffset
16712  * else:
16713  */
16714  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16715  if (__pyx_t_2) {
16716 
16717  /* "View.MemoryView":892
16718  * if not is_slice:
16719  * if new_ndim == 0:
16720  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16721  * else:
16722  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16723  */
16724  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16725 
16726  /* "View.MemoryView":891
16727  * if suboffset >= 0:
16728  * if not is_slice:
16729  * if new_ndim == 0: # <<<<<<<<<<<<<<
16730  * dst.data = (<char **> dst.data)[0] + suboffset
16731  * else:
16732  */
16733  goto __pyx_L26;
16734  }
16735 
16736  /* "View.MemoryView":894
16737  * dst.data = (<char **> dst.data)[0] + suboffset
16738  * else:
16739  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16740  * "must be indexed and not sliced", dim)
16741  * else:
16742  */
16743  /*else*/ {
16744 
16745  /* "View.MemoryView":895
16746  * else:
16747  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16748  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16749  * else:
16750  * suboffset_dim[0] = new_ndim
16751  */
16752  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 894, __pyx_L1_error)
16753  }
16754  __pyx_L26:;
16755 
16756  /* "View.MemoryView":890
16757  *
16758  * if suboffset >= 0:
16759  * if not is_slice: # <<<<<<<<<<<<<<
16760  * if new_ndim == 0:
16761  * dst.data = (<char **> dst.data)[0] + suboffset
16762  */
16763  goto __pyx_L25;
16764  }
16765 
16766  /* "View.MemoryView":897
16767  * "must be indexed and not sliced", dim)
16768  * else:
16769  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16770  *
16771  * return 0
16772  */
16773  /*else*/ {
16774  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16775  }
16776  __pyx_L25:;
16777 
16778  /* "View.MemoryView":889
16779  * dst.suboffsets[suboffset_dim[0]] += start * stride
16780  *
16781  * if suboffset >= 0: # <<<<<<<<<<<<<<
16782  * if not is_slice:
16783  * if new_ndim == 0:
16784  */
16785  }
16786 
16787  /* "View.MemoryView":899
16788  * suboffset_dim[0] = new_ndim
16789  *
16790  * return 0 # <<<<<<<<<<<<<<
16791  *
16792  *
16793  */
16794  __pyx_r = 0;
16795  goto __pyx_L0;
16796 
16797  /* "View.MemoryView":802
16798  *
16799  * @cname('__pyx_memoryview_slice_memviewslice')
16800  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16801  * __Pyx_memviewslice *dst,
16802  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16803  */
16804 
16805  /* function exit code */
16806  __pyx_L1_error:;
16807  {
16808  #ifdef WITH_THREAD
16809  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16810  #endif
16811  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16812  #ifdef WITH_THREAD
16813  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16814  #endif
16815  }
16816  __pyx_r = -1;
16817  __pyx_L0:;
16818  return __pyx_r;
16819 }
16820 
16821 /* "View.MemoryView":905
16822  *
16823  * @cname('__pyx_pybuffer_index')
16824  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16825  * Py_ssize_t dim) except NULL:
16826  * cdef Py_ssize_t shape, stride, suboffset = -1
16827  */
16828 
16829 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16830  Py_ssize_t __pyx_v_shape;
16831  Py_ssize_t __pyx_v_stride;
16832  Py_ssize_t __pyx_v_suboffset;
16833  Py_ssize_t __pyx_v_itemsize;
16834  char *__pyx_v_resultp;
16835  char *__pyx_r;
16836  __Pyx_RefNannyDeclarations
16837  Py_ssize_t __pyx_t_1;
16838  int __pyx_t_2;
16839  PyObject *__pyx_t_3 = NULL;
16840  PyObject *__pyx_t_4 = NULL;
16841  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16842 
16843  /* "View.MemoryView":907
16844  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16845  * Py_ssize_t dim) except NULL:
16846  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16847  * cdef Py_ssize_t itemsize = view.itemsize
16848  * cdef char *resultp
16849  */
16850  __pyx_v_suboffset = -1L;
16851 
16852  /* "View.MemoryView":908
16853  * Py_ssize_t dim) except NULL:
16854  * cdef Py_ssize_t shape, stride, suboffset = -1
16855  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16856  * cdef char *resultp
16857  *
16858  */
16859  __pyx_t_1 = __pyx_v_view->itemsize;
16860  __pyx_v_itemsize = __pyx_t_1;
16861 
16862  /* "View.MemoryView":911
16863  * cdef char *resultp
16864  *
16865  * if view.ndim == 0: # <<<<<<<<<<<<<<
16866  * shape = view.len / itemsize
16867  * stride = itemsize
16868  */
16869  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16870  if (__pyx_t_2) {
16871 
16872  /* "View.MemoryView":912
16873  *
16874  * if view.ndim == 0:
16875  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16876  * stride = itemsize
16877  * else:
16878  */
16879  if (unlikely(__pyx_v_itemsize == 0)) {
16880  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16881  __PYX_ERR(1, 912, __pyx_L1_error)
16882  }
16883  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16884  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16885  __PYX_ERR(1, 912, __pyx_L1_error)
16886  }
16887  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16888 
16889  /* "View.MemoryView":913
16890  * if view.ndim == 0:
16891  * shape = view.len / itemsize
16892  * stride = itemsize # <<<<<<<<<<<<<<
16893  * else:
16894  * shape = view.shape[dim]
16895  */
16896  __pyx_v_stride = __pyx_v_itemsize;
16897 
16898  /* "View.MemoryView":911
16899  * cdef char *resultp
16900  *
16901  * if view.ndim == 0: # <<<<<<<<<<<<<<
16902  * shape = view.len / itemsize
16903  * stride = itemsize
16904  */
16905  goto __pyx_L3;
16906  }
16907 
16908  /* "View.MemoryView":915
16909  * stride = itemsize
16910  * else:
16911  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16912  * stride = view.strides[dim]
16913  * if view.suboffsets != NULL:
16914  */
16915  /*else*/ {
16916  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16917 
16918  /* "View.MemoryView":916
16919  * else:
16920  * shape = view.shape[dim]
16921  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16922  * if view.suboffsets != NULL:
16923  * suboffset = view.suboffsets[dim]
16924  */
16925  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16926 
16927  /* "View.MemoryView":917
16928  * shape = view.shape[dim]
16929  * stride = view.strides[dim]
16930  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16931  * suboffset = view.suboffsets[dim]
16932  *
16933  */
16934  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16935  if (__pyx_t_2) {
16936 
16937  /* "View.MemoryView":918
16938  * stride = view.strides[dim]
16939  * if view.suboffsets != NULL:
16940  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16941  *
16942  * if index < 0:
16943  */
16944  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16945 
16946  /* "View.MemoryView":917
16947  * shape = view.shape[dim]
16948  * stride = view.strides[dim]
16949  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16950  * suboffset = view.suboffsets[dim]
16951  *
16952  */
16953  }
16954  }
16955  __pyx_L3:;
16956 
16957  /* "View.MemoryView":920
16958  * suboffset = view.suboffsets[dim]
16959  *
16960  * if index < 0: # <<<<<<<<<<<<<<
16961  * index += view.shape[dim]
16962  * if index < 0:
16963  */
16964  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16965  if (__pyx_t_2) {
16966 
16967  /* "View.MemoryView":921
16968  *
16969  * if index < 0:
16970  * index += view.shape[dim] # <<<<<<<<<<<<<<
16971  * if index < 0:
16972  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16973  */
16974  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16975 
16976  /* "View.MemoryView":922
16977  * if index < 0:
16978  * index += view.shape[dim]
16979  * if index < 0: # <<<<<<<<<<<<<<
16980  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16981  *
16982  */
16983  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16984  if (unlikely(__pyx_t_2)) {
16985 
16986  /* "View.MemoryView":923
16987  * index += view.shape[dim]
16988  * if index < 0:
16989  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16990  *
16991  * if index >= shape:
16992  */
16993  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
16994  __Pyx_GOTREF(__pyx_t_3);
16995  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error)
16996  __Pyx_GOTREF(__pyx_t_4);
16997  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16998  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
16999  __Pyx_GOTREF(__pyx_t_3);
17000  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17001  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17002  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17003  __PYX_ERR(1, 923, __pyx_L1_error)
17004 
17005  /* "View.MemoryView":922
17006  * if index < 0:
17007  * index += view.shape[dim]
17008  * if index < 0: # <<<<<<<<<<<<<<
17009  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17010  *
17011  */
17012  }
17013 
17014  /* "View.MemoryView":920
17015  * suboffset = view.suboffsets[dim]
17016  *
17017  * if index < 0: # <<<<<<<<<<<<<<
17018  * index += view.shape[dim]
17019  * if index < 0:
17020  */
17021  }
17022 
17023  /* "View.MemoryView":925
17024  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17025  *
17026  * if index >= shape: # <<<<<<<<<<<<<<
17027  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17028  *
17029  */
17030  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17031  if (unlikely(__pyx_t_2)) {
17032 
17033  /* "View.MemoryView":926
17034  *
17035  * if index >= shape:
17036  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17037  *
17038  * resultp = bufp + index * stride
17039  */
17040  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
17041  __Pyx_GOTREF(__pyx_t_3);
17042  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 926, __pyx_L1_error)
17043  __Pyx_GOTREF(__pyx_t_4);
17044  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17045  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
17046  __Pyx_GOTREF(__pyx_t_3);
17047  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17048  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17049  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17050  __PYX_ERR(1, 926, __pyx_L1_error)
17051 
17052  /* "View.MemoryView":925
17053  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17054  *
17055  * if index >= shape: # <<<<<<<<<<<<<<
17056  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17057  *
17058  */
17059  }
17060 
17061  /* "View.MemoryView":928
17062  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17063  *
17064  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17065  * if suboffset >= 0:
17066  * resultp = (<char **> resultp)[0] + suboffset
17067  */
17068  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17069 
17070  /* "View.MemoryView":929
17071  *
17072  * resultp = bufp + index * stride
17073  * if suboffset >= 0: # <<<<<<<<<<<<<<
17074  * resultp = (<char **> resultp)[0] + suboffset
17075  *
17076  */
17077  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17078  if (__pyx_t_2) {
17079 
17080  /* "View.MemoryView":930
17081  * resultp = bufp + index * stride
17082  * if suboffset >= 0:
17083  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17084  *
17085  * return resultp
17086  */
17087  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17088 
17089  /* "View.MemoryView":929
17090  *
17091  * resultp = bufp + index * stride
17092  * if suboffset >= 0: # <<<<<<<<<<<<<<
17093  * resultp = (<char **> resultp)[0] + suboffset
17094  *
17095  */
17096  }
17097 
17098  /* "View.MemoryView":932
17099  * resultp = (<char **> resultp)[0] + suboffset
17100  *
17101  * return resultp # <<<<<<<<<<<<<<
17102  *
17103  *
17104  */
17105  __pyx_r = __pyx_v_resultp;
17106  goto __pyx_L0;
17107 
17108  /* "View.MemoryView":905
17109  *
17110  * @cname('__pyx_pybuffer_index')
17111  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17112  * Py_ssize_t dim) except NULL:
17113  * cdef Py_ssize_t shape, stride, suboffset = -1
17114  */
17115 
17116  /* function exit code */
17117  __pyx_L1_error:;
17118  __Pyx_XDECREF(__pyx_t_3);
17119  __Pyx_XDECREF(__pyx_t_4);
17120  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17121  __pyx_r = NULL;
17122  __pyx_L0:;
17123  __Pyx_RefNannyFinishContext();
17124  return __pyx_r;
17125 }
17126 
17127 /* "View.MemoryView":938
17128  *
17129  * @cname('__pyx_memslice_transpose')
17130  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17131  * cdef int ndim = memslice.memview.view.ndim
17132  *
17133  */
17134 
17135 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17136  int __pyx_v_ndim;
17137  Py_ssize_t *__pyx_v_shape;
17138  Py_ssize_t *__pyx_v_strides;
17139  int __pyx_v_i;
17140  int __pyx_v_j;
17141  int __pyx_r;
17142  int __pyx_t_1;
17143  Py_ssize_t *__pyx_t_2;
17144  long __pyx_t_3;
17145  long __pyx_t_4;
17146  Py_ssize_t __pyx_t_5;
17147  Py_ssize_t __pyx_t_6;
17148  int __pyx_t_7;
17149  int __pyx_t_8;
17150  int __pyx_t_9;
17151 
17152  /* "View.MemoryView":939
17153  * @cname('__pyx_memslice_transpose')
17154  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17155  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17156  *
17157  * cdef Py_ssize_t *shape = memslice.shape
17158  */
17159  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17160  __pyx_v_ndim = __pyx_t_1;
17161 
17162  /* "View.MemoryView":941
17163  * cdef int ndim = memslice.memview.view.ndim
17164  *
17165  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17166  * cdef Py_ssize_t *strides = memslice.strides
17167  *
17168  */
17169  __pyx_t_2 = __pyx_v_memslice->shape;
17170  __pyx_v_shape = __pyx_t_2;
17171 
17172  /* "View.MemoryView":942
17173  *
17174  * cdef Py_ssize_t *shape = memslice.shape
17175  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17176  *
17177  *
17178  */
17179  __pyx_t_2 = __pyx_v_memslice->strides;
17180  __pyx_v_strides = __pyx_t_2;
17181 
17182  /* "View.MemoryView":946
17183  *
17184  * cdef int i, j
17185  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17186  * j = ndim - 1 - i
17187  * strides[i], strides[j] = strides[j], strides[i]
17188  */
17189  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17190  __pyx_t_4 = __pyx_t_3;
17191  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17192  __pyx_v_i = __pyx_t_1;
17193 
17194  /* "View.MemoryView":947
17195  * cdef int i, j
17196  * for i in range(ndim / 2):
17197  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17198  * strides[i], strides[j] = strides[j], strides[i]
17199  * shape[i], shape[j] = shape[j], shape[i]
17200  */
17201  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17202 
17203  /* "View.MemoryView":948
17204  * for i in range(ndim / 2):
17205  * j = ndim - 1 - i
17206  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17207  * shape[i], shape[j] = shape[j], shape[i]
17208  *
17209  */
17210  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17211  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17212  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17213  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17214 
17215  /* "View.MemoryView":949
17216  * j = ndim - 1 - i
17217  * strides[i], strides[j] = strides[j], strides[i]
17218  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17219  *
17220  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17221  */
17222  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17223  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17224  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17225  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17226 
17227  /* "View.MemoryView":951
17228  * shape[i], shape[j] = shape[j], shape[i]
17229  *
17230  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17231  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17232  *
17233  */
17234  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17235  if (!__pyx_t_8) {
17236  } else {
17237  __pyx_t_7 = __pyx_t_8;
17238  goto __pyx_L6_bool_binop_done;
17239  }
17240  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17241  __pyx_t_7 = __pyx_t_8;
17242  __pyx_L6_bool_binop_done:;
17243  if (__pyx_t_7) {
17244 
17245  /* "View.MemoryView":952
17246  *
17247  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17248  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17249  *
17250  * return 1
17251  */
17252  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 952, __pyx_L1_error)
17253 
17254  /* "View.MemoryView":951
17255  * shape[i], shape[j] = shape[j], shape[i]
17256  *
17257  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17258  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17259  *
17260  */
17261  }
17262  }
17263 
17264  /* "View.MemoryView":954
17265  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17266  *
17267  * return 1 # <<<<<<<<<<<<<<
17268  *
17269  *
17270  */
17271  __pyx_r = 1;
17272  goto __pyx_L0;
17273 
17274  /* "View.MemoryView":938
17275  *
17276  * @cname('__pyx_memslice_transpose')
17277  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17278  * cdef int ndim = memslice.memview.view.ndim
17279  *
17280  */
17281 
17282  /* function exit code */
17283  __pyx_L1_error:;
17284  {
17285  #ifdef WITH_THREAD
17286  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17287  #endif
17288  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17289  #ifdef WITH_THREAD
17290  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17291  #endif
17292  }
17293  __pyx_r = 0;
17294  __pyx_L0:;
17295  return __pyx_r;
17296 }
17297 
17298 /* "View.MemoryView":971
17299  * cdef int (*to_dtype_func)(char *, object) except 0
17300  *
17301  * def __dealloc__(self): # <<<<<<<<<<<<<<
17302  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17303  *
17304  */
17305 
17306 /* Python wrapper */
17307 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17308 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17309  __Pyx_RefNannyDeclarations
17310  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17311  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17312 
17313  /* function exit code */
17314  __Pyx_RefNannyFinishContext();
17315 }
17316 
17317 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17318  __Pyx_RefNannyDeclarations
17319  __Pyx_RefNannySetupContext("__dealloc__", 0);
17320 
17321  /* "View.MemoryView":972
17322  *
17323  * def __dealloc__(self):
17324  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17325  *
17326  * cdef convert_item_to_object(self, char *itemp):
17327  */
17328  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17329 
17330  /* "View.MemoryView":971
17331  * cdef int (*to_dtype_func)(char *, object) except 0
17332  *
17333  * def __dealloc__(self): # <<<<<<<<<<<<<<
17334  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17335  *
17336  */
17337 
17338  /* function exit code */
17339  __Pyx_RefNannyFinishContext();
17340 }
17341 
17342 /* "View.MemoryView":974
17343  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17344  *
17345  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17346  * if self.to_object_func != NULL:
17347  * return self.to_object_func(itemp)
17348  */
17349 
17350 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17351  PyObject *__pyx_r = NULL;
17352  __Pyx_RefNannyDeclarations
17353  int __pyx_t_1;
17354  PyObject *__pyx_t_2 = NULL;
17355  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17356 
17357  /* "View.MemoryView":975
17358  *
17359  * cdef convert_item_to_object(self, char *itemp):
17360  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17361  * return self.to_object_func(itemp)
17362  * else:
17363  */
17364  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17365  if (__pyx_t_1) {
17366 
17367  /* "View.MemoryView":976
17368  * cdef convert_item_to_object(self, char *itemp):
17369  * if self.to_object_func != NULL:
17370  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17371  * else:
17372  * return memoryview.convert_item_to_object(self, itemp)
17373  */
17374  __Pyx_XDECREF(__pyx_r);
17375  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 976, __pyx_L1_error)
17376  __Pyx_GOTREF(__pyx_t_2);
17377  __pyx_r = __pyx_t_2;
17378  __pyx_t_2 = 0;
17379  goto __pyx_L0;
17380 
17381  /* "View.MemoryView":975
17382  *
17383  * cdef convert_item_to_object(self, char *itemp):
17384  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17385  * return self.to_object_func(itemp)
17386  * else:
17387  */
17388  }
17389 
17390  /* "View.MemoryView":978
17391  * return self.to_object_func(itemp)
17392  * else:
17393  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17394  *
17395  * cdef assign_item_from_object(self, char *itemp, object value):
17396  */
17397  /*else*/ {
17398  __Pyx_XDECREF(__pyx_r);
17399  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 978, __pyx_L1_error)
17400  __Pyx_GOTREF(__pyx_t_2);
17401  __pyx_r = __pyx_t_2;
17402  __pyx_t_2 = 0;
17403  goto __pyx_L0;
17404  }
17405 
17406  /* "View.MemoryView":974
17407  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17408  *
17409  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17410  * if self.to_object_func != NULL:
17411  * return self.to_object_func(itemp)
17412  */
17413 
17414  /* function exit code */
17415  __pyx_L1_error:;
17416  __Pyx_XDECREF(__pyx_t_2);
17417  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17418  __pyx_r = 0;
17419  __pyx_L0:;
17420  __Pyx_XGIVEREF(__pyx_r);
17421  __Pyx_RefNannyFinishContext();
17422  return __pyx_r;
17423 }
17424 
17425 /* "View.MemoryView":980
17426  * return memoryview.convert_item_to_object(self, itemp)
17427  *
17428  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17429  * if self.to_dtype_func != NULL:
17430  * self.to_dtype_func(itemp, value)
17431  */
17432 
17433 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17434  PyObject *__pyx_r = NULL;
17435  __Pyx_RefNannyDeclarations
17436  int __pyx_t_1;
17437  int __pyx_t_2;
17438  PyObject *__pyx_t_3 = NULL;
17439  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17440 
17441  /* "View.MemoryView":981
17442  *
17443  * cdef assign_item_from_object(self, char *itemp, object value):
17444  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17445  * self.to_dtype_func(itemp, value)
17446  * else:
17447  */
17448  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17449  if (__pyx_t_1) {
17450 
17451  /* "View.MemoryView":982
17452  * cdef assign_item_from_object(self, char *itemp, object value):
17453  * if self.to_dtype_func != NULL:
17454  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17455  * else:
17456  * memoryview.assign_item_from_object(self, itemp, value)
17457  */
17458  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 982, __pyx_L1_error)
17459 
17460  /* "View.MemoryView":981
17461  *
17462  * cdef assign_item_from_object(self, char *itemp, object value):
17463  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17464  * self.to_dtype_func(itemp, value)
17465  * else:
17466  */
17467  goto __pyx_L3;
17468  }
17469 
17470  /* "View.MemoryView":984
17471  * self.to_dtype_func(itemp, value)
17472  * else:
17473  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17474  *
17475  * @property
17476  */
17477  /*else*/ {
17478  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 984, __pyx_L1_error)
17479  __Pyx_GOTREF(__pyx_t_3);
17480  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17481  }
17482  __pyx_L3:;
17483 
17484  /* "View.MemoryView":980
17485  * return memoryview.convert_item_to_object(self, itemp)
17486  *
17487  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17488  * if self.to_dtype_func != NULL:
17489  * self.to_dtype_func(itemp, value)
17490  */
17491 
17492  /* function exit code */
17493  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17494  goto __pyx_L0;
17495  __pyx_L1_error:;
17496  __Pyx_XDECREF(__pyx_t_3);
17497  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17498  __pyx_r = 0;
17499  __pyx_L0:;
17500  __Pyx_XGIVEREF(__pyx_r);
17501  __Pyx_RefNannyFinishContext();
17502  return __pyx_r;
17503 }
17504 
17505 /* "View.MemoryView":987
17506  *
17507  * @property
17508  * def base(self): # <<<<<<<<<<<<<<
17509  * return self.from_object
17510  *
17511  */
17512 
17513 /* Python wrapper */
17514 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17515 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17516  PyObject *__pyx_r = 0;
17517  __Pyx_RefNannyDeclarations
17518  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17519  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17520 
17521  /* function exit code */
17522  __Pyx_RefNannyFinishContext();
17523  return __pyx_r;
17524 }
17525 
17526 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17527  PyObject *__pyx_r = NULL;
17528  __Pyx_RefNannyDeclarations
17529  __Pyx_RefNannySetupContext("__get__", 0);
17530 
17531  /* "View.MemoryView":988
17532  * @property
17533  * def base(self):
17534  * return self.from_object # <<<<<<<<<<<<<<
17535  *
17536  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17537  */
17538  __Pyx_XDECREF(__pyx_r);
17539  __Pyx_INCREF(__pyx_v_self->from_object);
17540  __pyx_r = __pyx_v_self->from_object;
17541  goto __pyx_L0;
17542 
17543  /* "View.MemoryView":987
17544  *
17545  * @property
17546  * def base(self): # <<<<<<<<<<<<<<
17547  * return self.from_object
17548  *
17549  */
17550 
17551  /* function exit code */
17552  __pyx_L0:;
17553  __Pyx_XGIVEREF(__pyx_r);
17554  __Pyx_RefNannyFinishContext();
17555  return __pyx_r;
17556 }
17557 
17558 /* "(tree fragment)":1
17559  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17560  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17561  * def __setstate_cython__(self, __pyx_state):
17562  */
17563 
17564 /* Python wrapper */
17565 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17566 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17567  PyObject *__pyx_r = 0;
17568  __Pyx_RefNannyDeclarations
17569  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17570  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17571 
17572  /* function exit code */
17573  __Pyx_RefNannyFinishContext();
17574  return __pyx_r;
17575 }
17576 
17577 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17578  PyObject *__pyx_r = NULL;
17579  __Pyx_RefNannyDeclarations
17580  PyObject *__pyx_t_1 = NULL;
17581  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17582 
17583  /* "(tree fragment)":2
17584  * def __reduce_cython__(self):
17585  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17586  * def __setstate_cython__(self, __pyx_state):
17587  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17588  */
17589  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17590  __Pyx_GOTREF(__pyx_t_1);
17591  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17592  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17593  __PYX_ERR(1, 2, __pyx_L1_error)
17594 
17595  /* "(tree fragment)":1
17596  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17597  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17598  * def __setstate_cython__(self, __pyx_state):
17599  */
17600 
17601  /* function exit code */
17602  __pyx_L1_error:;
17603  __Pyx_XDECREF(__pyx_t_1);
17604  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17605  __pyx_r = NULL;
17606  __Pyx_XGIVEREF(__pyx_r);
17607  __Pyx_RefNannyFinishContext();
17608  return __pyx_r;
17609 }
17610 
17611 /* "(tree fragment)":3
17612  * def __reduce_cython__(self):
17613  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17614  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17615  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17616  */
17617 
17618 /* Python wrapper */
17619 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17620 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17621  PyObject *__pyx_r = 0;
17622  __Pyx_RefNannyDeclarations
17623  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17624  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17625 
17626  /* function exit code */
17627  __Pyx_RefNannyFinishContext();
17628  return __pyx_r;
17629 }
17630 
17631 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17632  PyObject *__pyx_r = NULL;
17633  __Pyx_RefNannyDeclarations
17634  PyObject *__pyx_t_1 = NULL;
17635  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17636 
17637  /* "(tree fragment)":4
17638  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17639  * def __setstate_cython__(self, __pyx_state):
17640  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17641  */
17642  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17643  __Pyx_GOTREF(__pyx_t_1);
17644  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17645  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17646  __PYX_ERR(1, 4, __pyx_L1_error)
17647 
17648  /* "(tree fragment)":3
17649  * def __reduce_cython__(self):
17650  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17651  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17652  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17653  */
17654 
17655  /* function exit code */
17656  __pyx_L1_error:;
17657  __Pyx_XDECREF(__pyx_t_1);
17658  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17659  __pyx_r = NULL;
17660  __Pyx_XGIVEREF(__pyx_r);
17661  __Pyx_RefNannyFinishContext();
17662  return __pyx_r;
17663 }
17664 
17665 /* "View.MemoryView":994
17666  *
17667  * @cname('__pyx_memoryview_fromslice')
17668  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17669  * int ndim,
17670  * object (*to_object_func)(char *),
17671  */
17672 
17673 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17674  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17675  Py_ssize_t __pyx_v_suboffset;
17676  PyObject *__pyx_v_length = NULL;
17677  PyObject *__pyx_r = NULL;
17678  __Pyx_RefNannyDeclarations
17679  int __pyx_t_1;
17680  PyObject *__pyx_t_2 = NULL;
17681  PyObject *__pyx_t_3 = NULL;
17682  __Pyx_TypeInfo *__pyx_t_4;
17683  Py_buffer __pyx_t_5;
17684  Py_ssize_t *__pyx_t_6;
17685  Py_ssize_t *__pyx_t_7;
17686  Py_ssize_t *__pyx_t_8;
17687  Py_ssize_t __pyx_t_9;
17688  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17689 
17690  /* "View.MemoryView":1002
17691  * cdef _memoryviewslice result
17692  *
17693  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17694  * return None
17695  *
17696  */
17697  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17698  if (__pyx_t_1) {
17699 
17700  /* "View.MemoryView":1003
17701  *
17702  * if <PyObject *> memviewslice.memview == Py_None:
17703  * return None # <<<<<<<<<<<<<<
17704  *
17705  *
17706  */
17707  __Pyx_XDECREF(__pyx_r);
17708  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17709  goto __pyx_L0;
17710 
17711  /* "View.MemoryView":1002
17712  * cdef _memoryviewslice result
17713  *
17714  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17715  * return None
17716  *
17717  */
17718  }
17719 
17720  /* "View.MemoryView":1008
17721  *
17722  *
17723  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17724  *
17725  * result.from_slice = memviewslice
17726  */
17727  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
17728  __Pyx_GOTREF(__pyx_t_2);
17729  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1008, __pyx_L1_error)
17730  __Pyx_GOTREF(__pyx_t_3);
17731  __Pyx_INCREF(Py_None);
17732  __Pyx_GIVEREF(Py_None);
17733  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17734  __Pyx_INCREF(__pyx_int_0);
17735  __Pyx_GIVEREF(__pyx_int_0);
17736  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17737  __Pyx_GIVEREF(__pyx_t_2);
17738  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17739  __pyx_t_2 = 0;
17740  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
17741  __Pyx_GOTREF(__pyx_t_2);
17742  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17743  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17744  __pyx_t_2 = 0;
17745 
17746  /* "View.MemoryView":1010
17747  * result = _memoryviewslice(None, 0, dtype_is_object)
17748  *
17749  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17750  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17751  *
17752  */
17753  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17754 
17755  /* "View.MemoryView":1011
17756  *
17757  * result.from_slice = memviewslice
17758  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17759  *
17760  * result.from_object = (<memoryview> memviewslice.memview).base
17761  */
17762  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17763 
17764  /* "View.MemoryView":1013
17765  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17766  *
17767  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17768  * result.typeinfo = memviewslice.memview.typeinfo
17769  *
17770  */
17771  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17772  __Pyx_GOTREF(__pyx_t_2);
17773  __Pyx_GIVEREF(__pyx_t_2);
17774  __Pyx_GOTREF(__pyx_v_result->from_object);
17775  __Pyx_DECREF(__pyx_v_result->from_object);
17776  __pyx_v_result->from_object = __pyx_t_2;
17777  __pyx_t_2 = 0;
17778 
17779  /* "View.MemoryView":1014
17780  *
17781  * result.from_object = (<memoryview> memviewslice.memview).base
17782  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17783  *
17784  * result.view = memviewslice.memview.view
17785  */
17786  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17787  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17788 
17789  /* "View.MemoryView":1016
17790  * result.typeinfo = memviewslice.memview.typeinfo
17791  *
17792  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17793  * result.view.buf = <void *> memviewslice.data
17794  * result.view.ndim = ndim
17795  */
17796  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17797  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17798 
17799  /* "View.MemoryView":1017
17800  *
17801  * result.view = memviewslice.memview.view
17802  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17803  * result.view.ndim = ndim
17804  * (<__pyx_buffer *> &result.view).obj = Py_None
17805  */
17806  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17807 
17808  /* "View.MemoryView":1018
17809  * result.view = memviewslice.memview.view
17810  * result.view.buf = <void *> memviewslice.data
17811  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17812  * (<__pyx_buffer *> &result.view).obj = Py_None
17813  * Py_INCREF(Py_None)
17814  */
17815  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17816 
17817  /* "View.MemoryView":1019
17818  * result.view.buf = <void *> memviewslice.data
17819  * result.view.ndim = ndim
17820  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17821  * Py_INCREF(Py_None)
17822  *
17823  */
17824  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17825 
17826  /* "View.MemoryView":1020
17827  * result.view.ndim = ndim
17828  * (<__pyx_buffer *> &result.view).obj = Py_None
17829  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17830  *
17831  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17832  */
17833  Py_INCREF(Py_None);
17834 
17835  /* "View.MemoryView":1022
17836  * Py_INCREF(Py_None)
17837  *
17838  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17839  * result.flags = PyBUF_RECORDS
17840  * else:
17841  */
17842  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17843  if (__pyx_t_1) {
17844 
17845  /* "View.MemoryView":1023
17846  *
17847  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17848  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17849  * else:
17850  * result.flags = PyBUF_RECORDS_RO
17851  */
17852  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17853 
17854  /* "View.MemoryView":1022
17855  * Py_INCREF(Py_None)
17856  *
17857  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17858  * result.flags = PyBUF_RECORDS
17859  * else:
17860  */
17861  goto __pyx_L4;
17862  }
17863 
17864  /* "View.MemoryView":1025
17865  * result.flags = PyBUF_RECORDS
17866  * else:
17867  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17868  *
17869  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17870  */
17871  /*else*/ {
17872  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17873  }
17874  __pyx_L4:;
17875 
17876  /* "View.MemoryView":1027
17877  * result.flags = PyBUF_RECORDS_RO
17878  *
17879  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17880  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17881  *
17882  */
17883  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17884 
17885  /* "View.MemoryView":1028
17886  *
17887  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17888  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17889  *
17890  *
17891  */
17892  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17893 
17894  /* "View.MemoryView":1031
17895  *
17896  *
17897  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17898  * for suboffset in result.from_slice.suboffsets[:ndim]:
17899  * if suboffset >= 0:
17900  */
17901  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17902 
17903  /* "View.MemoryView":1032
17904  *
17905  * result.view.suboffsets = NULL
17906  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17907  * if suboffset >= 0:
17908  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17909  */
17910  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17911  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17912  __pyx_t_6 = __pyx_t_8;
17913  __pyx_v_suboffset = (__pyx_t_6[0]);
17914 
17915  /* "View.MemoryView":1033
17916  * result.view.suboffsets = NULL
17917  * for suboffset in result.from_slice.suboffsets[:ndim]:
17918  * if suboffset >= 0: # <<<<<<<<<<<<<<
17919  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17920  * break
17921  */
17922  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17923  if (__pyx_t_1) {
17924 
17925  /* "View.MemoryView":1034
17926  * for suboffset in result.from_slice.suboffsets[:ndim]:
17927  * if suboffset >= 0:
17928  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17929  * break
17930  *
17931  */
17932  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17933 
17934  /* "View.MemoryView":1035
17935  * if suboffset >= 0:
17936  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17937  * break # <<<<<<<<<<<<<<
17938  *
17939  * result.view.len = result.view.itemsize
17940  */
17941  goto __pyx_L6_break;
17942 
17943  /* "View.MemoryView":1033
17944  * result.view.suboffsets = NULL
17945  * for suboffset in result.from_slice.suboffsets[:ndim]:
17946  * if suboffset >= 0: # <<<<<<<<<<<<<<
17947  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17948  * break
17949  */
17950  }
17951  }
17952  __pyx_L6_break:;
17953 
17954  /* "View.MemoryView":1037
17955  * break
17956  *
17957  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17958  * for length in result.view.shape[:ndim]:
17959  * result.view.len *= length
17960  */
17961  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17962  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17963 
17964  /* "View.MemoryView":1038
17965  *
17966  * result.view.len = result.view.itemsize
17967  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17968  * result.view.len *= length
17969  *
17970  */
17971  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17972  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17973  __pyx_t_6 = __pyx_t_8;
17974  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1038, __pyx_L1_error)
17975  __Pyx_GOTREF(__pyx_t_2);
17976  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17977  __pyx_t_2 = 0;
17978 
17979  /* "View.MemoryView":1039
17980  * result.view.len = result.view.itemsize
17981  * for length in result.view.shape[:ndim]:
17982  * result.view.len *= length # <<<<<<<<<<<<<<
17983  *
17984  * result.to_object_func = to_object_func
17985  */
17986  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
17987  __Pyx_GOTREF(__pyx_t_2);
17988  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1039, __pyx_L1_error)
17989  __Pyx_GOTREF(__pyx_t_3);
17990  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17991  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1039, __pyx_L1_error)
17992  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17993  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17994  }
17995 
17996  /* "View.MemoryView":1041
17997  * result.view.len *= length
17998  *
17999  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18000  * result.to_dtype_func = to_dtype_func
18001  *
18002  */
18003  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18004 
18005  /* "View.MemoryView":1042
18006  *
18007  * result.to_object_func = to_object_func
18008  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18009  *
18010  * return result
18011  */
18012  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18013 
18014  /* "View.MemoryView":1044
18015  * result.to_dtype_func = to_dtype_func
18016  *
18017  * return result # <<<<<<<<<<<<<<
18018  *
18019  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18020  */
18021  __Pyx_XDECREF(__pyx_r);
18022  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18023  __pyx_r = ((PyObject *)__pyx_v_result);
18024  goto __pyx_L0;
18025 
18026  /* "View.MemoryView":994
18027  *
18028  * @cname('__pyx_memoryview_fromslice')
18029  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18030  * int ndim,
18031  * object (*to_object_func)(char *),
18032  */
18033 
18034  /* function exit code */
18035  __pyx_L1_error:;
18036  __Pyx_XDECREF(__pyx_t_2);
18037  __Pyx_XDECREF(__pyx_t_3);
18038  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18039  __pyx_r = 0;
18040  __pyx_L0:;
18041  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18042  __Pyx_XDECREF(__pyx_v_length);
18043  __Pyx_XGIVEREF(__pyx_r);
18044  __Pyx_RefNannyFinishContext();
18045  return __pyx_r;
18046 }
18047 
18048 /* "View.MemoryView":1047
18049  *
18050  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18051  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18052  * __Pyx_memviewslice *mslice):
18053  * cdef _memoryviewslice obj
18054  */
18055 
18056 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18057  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18058  __Pyx_memviewslice *__pyx_r;
18059  __Pyx_RefNannyDeclarations
18060  int __pyx_t_1;
18061  int __pyx_t_2;
18062  PyObject *__pyx_t_3 = NULL;
18063  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18064 
18065  /* "View.MemoryView":1050
18066  * __Pyx_memviewslice *mslice):
18067  * cdef _memoryviewslice obj
18068  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18069  * obj = memview
18070  * return &obj.from_slice
18071  */
18072  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18073  __pyx_t_2 = (__pyx_t_1 != 0);
18074  if (__pyx_t_2) {
18075 
18076  /* "View.MemoryView":1051
18077  * cdef _memoryviewslice obj
18078  * if isinstance(memview, _memoryviewslice):
18079  * obj = memview # <<<<<<<<<<<<<<
18080  * return &obj.from_slice
18081  * else:
18082  */
18083  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1051, __pyx_L1_error)
18084  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18085  __Pyx_INCREF(__pyx_t_3);
18086  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18087  __pyx_t_3 = 0;
18088 
18089  /* "View.MemoryView":1052
18090  * if isinstance(memview, _memoryviewslice):
18091  * obj = memview
18092  * return &obj.from_slice # <<<<<<<<<<<<<<
18093  * else:
18094  * slice_copy(memview, mslice)
18095  */
18096  __pyx_r = (&__pyx_v_obj->from_slice);
18097  goto __pyx_L0;
18098 
18099  /* "View.MemoryView":1050
18100  * __Pyx_memviewslice *mslice):
18101  * cdef _memoryviewslice obj
18102  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18103  * obj = memview
18104  * return &obj.from_slice
18105  */
18106  }
18107 
18108  /* "View.MemoryView":1054
18109  * return &obj.from_slice
18110  * else:
18111  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18112  * return mslice
18113  *
18114  */
18115  /*else*/ {
18116  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18117 
18118  /* "View.MemoryView":1055
18119  * else:
18120  * slice_copy(memview, mslice)
18121  * return mslice # <<<<<<<<<<<<<<
18122  *
18123  * @cname('__pyx_memoryview_slice_copy')
18124  */
18125  __pyx_r = __pyx_v_mslice;
18126  goto __pyx_L0;
18127  }
18128 
18129  /* "View.MemoryView":1047
18130  *
18131  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18132  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18133  * __Pyx_memviewslice *mslice):
18134  * cdef _memoryviewslice obj
18135  */
18136 
18137  /* function exit code */
18138  __pyx_L1_error:;
18139  __Pyx_XDECREF(__pyx_t_3);
18140  __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18141  __pyx_r = 0;
18142  __pyx_L0:;
18143  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18144  __Pyx_RefNannyFinishContext();
18145  return __pyx_r;
18146 }
18147 
18148 /* "View.MemoryView":1058
18149  *
18150  * @cname('__pyx_memoryview_slice_copy')
18151  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18152  * cdef int dim
18153  * cdef (Py_ssize_t*) shape, strides, suboffsets
18154  */
18155 
18156 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18157  int __pyx_v_dim;
18158  Py_ssize_t *__pyx_v_shape;
18159  Py_ssize_t *__pyx_v_strides;
18160  Py_ssize_t *__pyx_v_suboffsets;
18161  __Pyx_RefNannyDeclarations
18162  Py_ssize_t *__pyx_t_1;
18163  int __pyx_t_2;
18164  int __pyx_t_3;
18165  int __pyx_t_4;
18166  Py_ssize_t __pyx_t_5;
18167  __Pyx_RefNannySetupContext("slice_copy", 0);
18168 
18169  /* "View.MemoryView":1062
18170  * cdef (Py_ssize_t*) shape, strides, suboffsets
18171  *
18172  * shape = memview.view.shape # <<<<<<<<<<<<<<
18173  * strides = memview.view.strides
18174  * suboffsets = memview.view.suboffsets
18175  */
18176  __pyx_t_1 = __pyx_v_memview->view.shape;
18177  __pyx_v_shape = __pyx_t_1;
18178 
18179  /* "View.MemoryView":1063
18180  *
18181  * shape = memview.view.shape
18182  * strides = memview.view.strides # <<<<<<<<<<<<<<
18183  * suboffsets = memview.view.suboffsets
18184  *
18185  */
18186  __pyx_t_1 = __pyx_v_memview->view.strides;
18187  __pyx_v_strides = __pyx_t_1;
18188 
18189  /* "View.MemoryView":1064
18190  * shape = memview.view.shape
18191  * strides = memview.view.strides
18192  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18193  *
18194  * dst.memview = <__pyx_memoryview *> memview
18195  */
18196  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18197  __pyx_v_suboffsets = __pyx_t_1;
18198 
18199  /* "View.MemoryView":1066
18200  * suboffsets = memview.view.suboffsets
18201  *
18202  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18203  * dst.data = <char *> memview.view.buf
18204  *
18205  */
18206  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18207 
18208  /* "View.MemoryView":1067
18209  *
18210  * dst.memview = <__pyx_memoryview *> memview
18211  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18212  *
18213  * for dim in range(memview.view.ndim):
18214  */
18215  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18216 
18217  /* "View.MemoryView":1069
18218  * dst.data = <char *> memview.view.buf
18219  *
18220  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18221  * dst.shape[dim] = shape[dim]
18222  * dst.strides[dim] = strides[dim]
18223  */
18224  __pyx_t_2 = __pyx_v_memview->view.ndim;
18225  __pyx_t_3 = __pyx_t_2;
18226  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18227  __pyx_v_dim = __pyx_t_4;
18228 
18229  /* "View.MemoryView":1070
18230  *
18231  * for dim in range(memview.view.ndim):
18232  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18233  * dst.strides[dim] = strides[dim]
18234  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18235  */
18236  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18237 
18238  /* "View.MemoryView":1071
18239  * for dim in range(memview.view.ndim):
18240  * dst.shape[dim] = shape[dim]
18241  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18242  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18243  *
18244  */
18245  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18246 
18247  /* "View.MemoryView":1072
18248  * dst.shape[dim] = shape[dim]
18249  * dst.strides[dim] = strides[dim]
18250  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18251  *
18252  * @cname('__pyx_memoryview_copy_object')
18253  */
18254  if ((__pyx_v_suboffsets != 0)) {
18255  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18256  } else {
18257  __pyx_t_5 = -1L;
18258  }
18259  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18260  }
18261 
18262  /* "View.MemoryView":1058
18263  *
18264  * @cname('__pyx_memoryview_slice_copy')
18265  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18266  * cdef int dim
18267  * cdef (Py_ssize_t*) shape, strides, suboffsets
18268  */
18269 
18270  /* function exit code */
18271  __Pyx_RefNannyFinishContext();
18272 }
18273 
18274 /* "View.MemoryView":1075
18275  *
18276  * @cname('__pyx_memoryview_copy_object')
18277  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18278  * "Create a new memoryview object"
18279  * cdef __Pyx_memviewslice memviewslice
18280  */
18281 
18282 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18283  __Pyx_memviewslice __pyx_v_memviewslice;
18284  PyObject *__pyx_r = NULL;
18285  __Pyx_RefNannyDeclarations
18286  PyObject *__pyx_t_1 = NULL;
18287  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18288 
18289  /* "View.MemoryView":1078
18290  * "Create a new memoryview object"
18291  * cdef __Pyx_memviewslice memviewslice
18292  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18293  * return memoryview_copy_from_slice(memview, &memviewslice)
18294  *
18295  */
18296  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18297 
18298  /* "View.MemoryView":1079
18299  * cdef __Pyx_memviewslice memviewslice
18300  * slice_copy(memview, &memviewslice)
18301  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18302  *
18303  * @cname('__pyx_memoryview_copy_object_from_slice')
18304  */
18305  __Pyx_XDECREF(__pyx_r);
18306  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1079, __pyx_L1_error)
18307  __Pyx_GOTREF(__pyx_t_1);
18308  __pyx_r = __pyx_t_1;
18309  __pyx_t_1 = 0;
18310  goto __pyx_L0;
18311 
18312  /* "View.MemoryView":1075
18313  *
18314  * @cname('__pyx_memoryview_copy_object')
18315  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18316  * "Create a new memoryview object"
18317  * cdef __Pyx_memviewslice memviewslice
18318  */
18319 
18320  /* function exit code */
18321  __pyx_L1_error:;
18322  __Pyx_XDECREF(__pyx_t_1);
18323  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18324  __pyx_r = 0;
18325  __pyx_L0:;
18326  __Pyx_XGIVEREF(__pyx_r);
18327  __Pyx_RefNannyFinishContext();
18328  return __pyx_r;
18329 }
18330 
18331 /* "View.MemoryView":1082
18332  *
18333  * @cname('__pyx_memoryview_copy_object_from_slice')
18334  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18335  * """
18336  * Create a new memoryview object from a given memoryview object and slice.
18337  */
18338 
18339 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18340  PyObject *(*__pyx_v_to_object_func)(char *);
18341  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18342  PyObject *__pyx_r = NULL;
18343  __Pyx_RefNannyDeclarations
18344  int __pyx_t_1;
18345  int __pyx_t_2;
18346  PyObject *(*__pyx_t_3)(char *);
18347  int (*__pyx_t_4)(char *, PyObject *);
18348  PyObject *__pyx_t_5 = NULL;
18349  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18350 
18351  /* "View.MemoryView":1089
18352  * cdef int (*to_dtype_func)(char *, object) except 0
18353  *
18354  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18355  * to_object_func = (<_memoryviewslice> memview).to_object_func
18356  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18357  */
18358  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18359  __pyx_t_2 = (__pyx_t_1 != 0);
18360  if (__pyx_t_2) {
18361 
18362  /* "View.MemoryView":1090
18363  *
18364  * if isinstance(memview, _memoryviewslice):
18365  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18366  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18367  * else:
18368  */
18369  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18370  __pyx_v_to_object_func = __pyx_t_3;
18371 
18372  /* "View.MemoryView":1091
18373  * if isinstance(memview, _memoryviewslice):
18374  * to_object_func = (<_memoryviewslice> memview).to_object_func
18375  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18376  * else:
18377  * to_object_func = NULL
18378  */
18379  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18380  __pyx_v_to_dtype_func = __pyx_t_4;
18381 
18382  /* "View.MemoryView":1089
18383  * cdef int (*to_dtype_func)(char *, object) except 0
18384  *
18385  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18386  * to_object_func = (<_memoryviewslice> memview).to_object_func
18387  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18388  */
18389  goto __pyx_L3;
18390  }
18391 
18392  /* "View.MemoryView":1093
18393  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18394  * else:
18395  * to_object_func = NULL # <<<<<<<<<<<<<<
18396  * to_dtype_func = NULL
18397  *
18398  */
18399  /*else*/ {
18400  __pyx_v_to_object_func = NULL;
18401 
18402  /* "View.MemoryView":1094
18403  * else:
18404  * to_object_func = NULL
18405  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18406  *
18407  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18408  */
18409  __pyx_v_to_dtype_func = NULL;
18410  }
18411  __pyx_L3:;
18412 
18413  /* "View.MemoryView":1096
18414  * to_dtype_func = NULL
18415  *
18416  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18417  * to_object_func, to_dtype_func,
18418  * memview.dtype_is_object)
18419  */
18420  __Pyx_XDECREF(__pyx_r);
18421 
18422  /* "View.MemoryView":1098
18423  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18424  * to_object_func, to_dtype_func,
18425  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18426  *
18427  *
18428  */
18429  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1096, __pyx_L1_error)
18430  __Pyx_GOTREF(__pyx_t_5);
18431  __pyx_r = __pyx_t_5;
18432  __pyx_t_5 = 0;
18433  goto __pyx_L0;
18434 
18435  /* "View.MemoryView":1082
18436  *
18437  * @cname('__pyx_memoryview_copy_object_from_slice')
18438  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18439  * """
18440  * Create a new memoryview object from a given memoryview object and slice.
18441  */
18442 
18443  /* function exit code */
18444  __pyx_L1_error:;
18445  __Pyx_XDECREF(__pyx_t_5);
18446  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18447  __pyx_r = 0;
18448  __pyx_L0:;
18449  __Pyx_XGIVEREF(__pyx_r);
18450  __Pyx_RefNannyFinishContext();
18451  return __pyx_r;
18452 }
18453 
18454 /* "View.MemoryView":1104
18455  *
18456  *
18457  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18458  * if arg < 0:
18459  * return -arg
18460  */
18461 
18462 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18463  Py_ssize_t __pyx_r;
18464  int __pyx_t_1;
18465 
18466  /* "View.MemoryView":1105
18467  *
18468  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18469  * if arg < 0: # <<<<<<<<<<<<<<
18470  * return -arg
18471  * else:
18472  */
18473  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18474  if (__pyx_t_1) {
18475 
18476  /* "View.MemoryView":1106
18477  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18478  * if arg < 0:
18479  * return -arg # <<<<<<<<<<<<<<
18480  * else:
18481  * return arg
18482  */
18483  __pyx_r = (-__pyx_v_arg);
18484  goto __pyx_L0;
18485 
18486  /* "View.MemoryView":1105
18487  *
18488  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18489  * if arg < 0: # <<<<<<<<<<<<<<
18490  * return -arg
18491  * else:
18492  */
18493  }
18494 
18495  /* "View.MemoryView":1108
18496  * return -arg
18497  * else:
18498  * return arg # <<<<<<<<<<<<<<
18499  *
18500  * @cname('__pyx_get_best_slice_order')
18501  */
18502  /*else*/ {
18503  __pyx_r = __pyx_v_arg;
18504  goto __pyx_L0;
18505  }
18506 
18507  /* "View.MemoryView":1104
18508  *
18509  *
18510  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18511  * if arg < 0:
18512  * return -arg
18513  */
18514 
18515  /* function exit code */
18516  __pyx_L0:;
18517  return __pyx_r;
18518 }
18519 
18520 /* "View.MemoryView":1111
18521  *
18522  * @cname('__pyx_get_best_slice_order')
18523  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18524  * """
18525  * Figure out the best memory access order for a given slice.
18526  */
18527 
18528 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18529  int __pyx_v_i;
18530  Py_ssize_t __pyx_v_c_stride;
18531  Py_ssize_t __pyx_v_f_stride;
18532  char __pyx_r;
18533  int __pyx_t_1;
18534  int __pyx_t_2;
18535  int __pyx_t_3;
18536  int __pyx_t_4;
18537 
18538  /* "View.MemoryView":1116
18539  * """
18540  * cdef int i
18541  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18542  * cdef Py_ssize_t f_stride = 0
18543  *
18544  */
18545  __pyx_v_c_stride = 0;
18546 
18547  /* "View.MemoryView":1117
18548  * cdef int i
18549  * cdef Py_ssize_t c_stride = 0
18550  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18551  *
18552  * for i in range(ndim - 1, -1, -1):
18553  */
18554  __pyx_v_f_stride = 0;
18555 
18556  /* "View.MemoryView":1119
18557  * cdef Py_ssize_t f_stride = 0
18558  *
18559  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18560  * if mslice.shape[i] > 1:
18561  * c_stride = mslice.strides[i]
18562  */
18563  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18564  __pyx_v_i = __pyx_t_1;
18565 
18566  /* "View.MemoryView":1120
18567  *
18568  * for i in range(ndim - 1, -1, -1):
18569  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18570  * c_stride = mslice.strides[i]
18571  * break
18572  */
18573  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18574  if (__pyx_t_2) {
18575 
18576  /* "View.MemoryView":1121
18577  * for i in range(ndim - 1, -1, -1):
18578  * if mslice.shape[i] > 1:
18579  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18580  * break
18581  *
18582  */
18583  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18584 
18585  /* "View.MemoryView":1122
18586  * if mslice.shape[i] > 1:
18587  * c_stride = mslice.strides[i]
18588  * break # <<<<<<<<<<<<<<
18589  *
18590  * for i in range(ndim):
18591  */
18592  goto __pyx_L4_break;
18593 
18594  /* "View.MemoryView":1120
18595  *
18596  * for i in range(ndim - 1, -1, -1):
18597  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18598  * c_stride = mslice.strides[i]
18599  * break
18600  */
18601  }
18602  }
18603  __pyx_L4_break:;
18604 
18605  /* "View.MemoryView":1124
18606  * break
18607  *
18608  * for i in range(ndim): # <<<<<<<<<<<<<<
18609  * if mslice.shape[i] > 1:
18610  * f_stride = mslice.strides[i]
18611  */
18612  __pyx_t_1 = __pyx_v_ndim;
18613  __pyx_t_3 = __pyx_t_1;
18614  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18615  __pyx_v_i = __pyx_t_4;
18616 
18617  /* "View.MemoryView":1125
18618  *
18619  * for i in range(ndim):
18620  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18621  * f_stride = mslice.strides[i]
18622  * break
18623  */
18624  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18625  if (__pyx_t_2) {
18626 
18627  /* "View.MemoryView":1126
18628  * for i in range(ndim):
18629  * if mslice.shape[i] > 1:
18630  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18631  * break
18632  *
18633  */
18634  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18635 
18636  /* "View.MemoryView":1127
18637  * if mslice.shape[i] > 1:
18638  * f_stride = mslice.strides[i]
18639  * break # <<<<<<<<<<<<<<
18640  *
18641  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18642  */
18643  goto __pyx_L7_break;
18644 
18645  /* "View.MemoryView":1125
18646  *
18647  * for i in range(ndim):
18648  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18649  * f_stride = mslice.strides[i]
18650  * break
18651  */
18652  }
18653  }
18654  __pyx_L7_break:;
18655 
18656  /* "View.MemoryView":1129
18657  * break
18658  *
18659  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18660  * return 'C'
18661  * else:
18662  */
18663  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18664  if (__pyx_t_2) {
18665 
18666  /* "View.MemoryView":1130
18667  *
18668  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18669  * return 'C' # <<<<<<<<<<<<<<
18670  * else:
18671  * return 'F'
18672  */
18673  __pyx_r = 'C';
18674  goto __pyx_L0;
18675 
18676  /* "View.MemoryView":1129
18677  * break
18678  *
18679  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18680  * return 'C'
18681  * else:
18682  */
18683  }
18684 
18685  /* "View.MemoryView":1132
18686  * return 'C'
18687  * else:
18688  * return 'F' # <<<<<<<<<<<<<<
18689  *
18690  * @cython.cdivision(True)
18691  */
18692  /*else*/ {
18693  __pyx_r = 'F';
18694  goto __pyx_L0;
18695  }
18696 
18697  /* "View.MemoryView":1111
18698  *
18699  * @cname('__pyx_get_best_slice_order')
18700  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18701  * """
18702  * Figure out the best memory access order for a given slice.
18703  */
18704 
18705  /* function exit code */
18706  __pyx_L0:;
18707  return __pyx_r;
18708 }
18709 
18710 /* "View.MemoryView":1135
18711  *
18712  * @cython.cdivision(True)
18713  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18714  * char *dst_data, Py_ssize_t *dst_strides,
18715  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18716  */
18717 
18718 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18719  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18720  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18721  Py_ssize_t __pyx_v_dst_extent;
18722  Py_ssize_t __pyx_v_src_stride;
18723  Py_ssize_t __pyx_v_dst_stride;
18724  int __pyx_t_1;
18725  int __pyx_t_2;
18726  int __pyx_t_3;
18727  Py_ssize_t __pyx_t_4;
18728  Py_ssize_t __pyx_t_5;
18729  Py_ssize_t __pyx_t_6;
18730 
18731  /* "View.MemoryView":1142
18732  *
18733  * cdef Py_ssize_t i
18734  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18735  * cdef Py_ssize_t dst_extent = dst_shape[0]
18736  * cdef Py_ssize_t src_stride = src_strides[0]
18737  */
18738  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18739 
18740  /* "View.MemoryView":1143
18741  * cdef Py_ssize_t i
18742  * cdef Py_ssize_t src_extent = src_shape[0]
18743  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18744  * cdef Py_ssize_t src_stride = src_strides[0]
18745  * cdef Py_ssize_t dst_stride = dst_strides[0]
18746  */
18747  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18748 
18749  /* "View.MemoryView":1144
18750  * cdef Py_ssize_t src_extent = src_shape[0]
18751  * cdef Py_ssize_t dst_extent = dst_shape[0]
18752  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18753  * cdef Py_ssize_t dst_stride = dst_strides[0]
18754  *
18755  */
18756  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18757 
18758  /* "View.MemoryView":1145
18759  * cdef Py_ssize_t dst_extent = dst_shape[0]
18760  * cdef Py_ssize_t src_stride = src_strides[0]
18761  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18762  *
18763  * if ndim == 1:
18764  */
18765  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18766 
18767  /* "View.MemoryView":1147
18768  * cdef Py_ssize_t dst_stride = dst_strides[0]
18769  *
18770  * if ndim == 1: # <<<<<<<<<<<<<<
18771  * if (src_stride > 0 and dst_stride > 0 and
18772  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18773  */
18774  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18775  if (__pyx_t_1) {
18776 
18777  /* "View.MemoryView":1148
18778  *
18779  * if ndim == 1:
18780  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18781  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18782  * memcpy(dst_data, src_data, itemsize * dst_extent)
18783  */
18784  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18785  if (__pyx_t_2) {
18786  } else {
18787  __pyx_t_1 = __pyx_t_2;
18788  goto __pyx_L5_bool_binop_done;
18789  }
18790  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18791  if (__pyx_t_2) {
18792  } else {
18793  __pyx_t_1 = __pyx_t_2;
18794  goto __pyx_L5_bool_binop_done;
18795  }
18796 
18797  /* "View.MemoryView":1149
18798  * if ndim == 1:
18799  * if (src_stride > 0 and dst_stride > 0 and
18800  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18801  * memcpy(dst_data, src_data, itemsize * dst_extent)
18802  * else:
18803  */
18804  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18805  if (__pyx_t_2) {
18806  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18807  }
18808  __pyx_t_3 = (__pyx_t_2 != 0);
18809  __pyx_t_1 = __pyx_t_3;
18810  __pyx_L5_bool_binop_done:;
18811 
18812  /* "View.MemoryView":1148
18813  *
18814  * if ndim == 1:
18815  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18816  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18817  * memcpy(dst_data, src_data, itemsize * dst_extent)
18818  */
18819  if (__pyx_t_1) {
18820 
18821  /* "View.MemoryView":1150
18822  * if (src_stride > 0 and dst_stride > 0 and
18823  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18824  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18825  * else:
18826  * for i in range(dst_extent):
18827  */
18828  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18829 
18830  /* "View.MemoryView":1148
18831  *
18832  * if ndim == 1:
18833  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18834  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18835  * memcpy(dst_data, src_data, itemsize * dst_extent)
18836  */
18837  goto __pyx_L4;
18838  }
18839 
18840  /* "View.MemoryView":1152
18841  * memcpy(dst_data, src_data, itemsize * dst_extent)
18842  * else:
18843  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18844  * memcpy(dst_data, src_data, itemsize)
18845  * src_data += src_stride
18846  */
18847  /*else*/ {
18848  __pyx_t_4 = __pyx_v_dst_extent;
18849  __pyx_t_5 = __pyx_t_4;
18850  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18851  __pyx_v_i = __pyx_t_6;
18852 
18853  /* "View.MemoryView":1153
18854  * else:
18855  * for i in range(dst_extent):
18856  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18857  * src_data += src_stride
18858  * dst_data += dst_stride
18859  */
18860  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18861 
18862  /* "View.MemoryView":1154
18863  * for i in range(dst_extent):
18864  * memcpy(dst_data, src_data, itemsize)
18865  * src_data += src_stride # <<<<<<<<<<<<<<
18866  * dst_data += dst_stride
18867  * else:
18868  */
18869  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18870 
18871  /* "View.MemoryView":1155
18872  * memcpy(dst_data, src_data, itemsize)
18873  * src_data += src_stride
18874  * dst_data += dst_stride # <<<<<<<<<<<<<<
18875  * else:
18876  * for i in range(dst_extent):
18877  */
18878  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18879  }
18880  }
18881  __pyx_L4:;
18882 
18883  /* "View.MemoryView":1147
18884  * cdef Py_ssize_t dst_stride = dst_strides[0]
18885  *
18886  * if ndim == 1: # <<<<<<<<<<<<<<
18887  * if (src_stride > 0 and dst_stride > 0 and
18888  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18889  */
18890  goto __pyx_L3;
18891  }
18892 
18893  /* "View.MemoryView":1157
18894  * dst_data += dst_stride
18895  * else:
18896  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18897  * _copy_strided_to_strided(src_data, src_strides + 1,
18898  * dst_data, dst_strides + 1,
18899  */
18900  /*else*/ {
18901  __pyx_t_4 = __pyx_v_dst_extent;
18902  __pyx_t_5 = __pyx_t_4;
18903  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18904  __pyx_v_i = __pyx_t_6;
18905 
18906  /* "View.MemoryView":1158
18907  * else:
18908  * for i in range(dst_extent):
18909  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18910  * dst_data, dst_strides + 1,
18911  * src_shape + 1, dst_shape + 1,
18912  */
18913  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18914 
18915  /* "View.MemoryView":1162
18916  * src_shape + 1, dst_shape + 1,
18917  * ndim - 1, itemsize)
18918  * src_data += src_stride # <<<<<<<<<<<<<<
18919  * dst_data += dst_stride
18920  *
18921  */
18922  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18923 
18924  /* "View.MemoryView":1163
18925  * ndim - 1, itemsize)
18926  * src_data += src_stride
18927  * dst_data += dst_stride # <<<<<<<<<<<<<<
18928  *
18929  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18930  */
18931  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18932  }
18933  }
18934  __pyx_L3:;
18935 
18936  /* "View.MemoryView":1135
18937  *
18938  * @cython.cdivision(True)
18939  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18940  * char *dst_data, Py_ssize_t *dst_strides,
18941  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18942  */
18943 
18944  /* function exit code */
18945 }
18946 
18947 /* "View.MemoryView":1165
18948  * dst_data += dst_stride
18949  *
18950  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18951  * __Pyx_memviewslice *dst,
18952  * int ndim, size_t itemsize) nogil:
18953  */
18954 
18955 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18956 
18957  /* "View.MemoryView":1168
18958  * __Pyx_memviewslice *dst,
18959  * int ndim, size_t itemsize) nogil:
18960  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18961  * src.shape, dst.shape, ndim, itemsize)
18962  *
18963  */
18964  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18965 
18966  /* "View.MemoryView":1165
18967  * dst_data += dst_stride
18968  *
18969  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18970  * __Pyx_memviewslice *dst,
18971  * int ndim, size_t itemsize) nogil:
18972  */
18973 
18974  /* function exit code */
18975 }
18976 
18977 /* "View.MemoryView":1172
18978  *
18979  * @cname('__pyx_memoryview_slice_get_size')
18980  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18981  * "Return the size of the memory occupied by the slice in number of bytes"
18982  * cdef int i
18983  */
18984 
18985 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18986  int __pyx_v_i;
18987  Py_ssize_t __pyx_v_size;
18988  Py_ssize_t __pyx_r;
18989  Py_ssize_t __pyx_t_1;
18990  int __pyx_t_2;
18991  int __pyx_t_3;
18992  int __pyx_t_4;
18993 
18994  /* "View.MemoryView":1175
18995  * "Return the size of the memory occupied by the slice in number of bytes"
18996  * cdef int i
18997  * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18998  *
18999  * for i in range(ndim):
19000  */
19001  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19002  __pyx_v_size = __pyx_t_1;
19003 
19004  /* "View.MemoryView":1177
19005  * cdef Py_ssize_t size = src.memview.view.itemsize
19006  *
19007  * for i in range(ndim): # <<<<<<<<<<<<<<
19008  * size *= src.shape[i]
19009  *
19010  */
19011  __pyx_t_2 = __pyx_v_ndim;
19012  __pyx_t_3 = __pyx_t_2;
19013  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19014  __pyx_v_i = __pyx_t_4;
19015 
19016  /* "View.MemoryView":1178
19017  *
19018  * for i in range(ndim):
19019  * size *= src.shape[i] # <<<<<<<<<<<<<<
19020  *
19021  * return size
19022  */
19023  __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
19024  }
19025 
19026  /* "View.MemoryView":1180
19027  * size *= src.shape[i]
19028  *
19029  * return size # <<<<<<<<<<<<<<
19030  *
19031  * @cname('__pyx_fill_contig_strides_array')
19032  */
19033  __pyx_r = __pyx_v_size;
19034  goto __pyx_L0;
19035 
19036  /* "View.MemoryView":1172
19037  *
19038  * @cname('__pyx_memoryview_slice_get_size')
19039  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19040  * "Return the size of the memory occupied by the slice in number of bytes"
19041  * cdef int i
19042  */
19043 
19044  /* function exit code */
19045  __pyx_L0:;
19046  return __pyx_r;
19047 }
19048 
19049 /* "View.MemoryView":1183
19050  *
19051  * @cname('__pyx_fill_contig_strides_array')
19052  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19053  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19054  * int ndim, char order) nogil:
19055  */
19056 
19057 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19058  int __pyx_v_idx;
19059  Py_ssize_t __pyx_r;
19060  int __pyx_t_1;
19061  int __pyx_t_2;
19062  int __pyx_t_3;
19063  int __pyx_t_4;
19064 
19065  /* "View.MemoryView":1192
19066  * cdef int idx
19067  *
19068  * if order == 'F': # <<<<<<<<<<<<<<
19069  * for idx in range(ndim):
19070  * strides[idx] = stride
19071  */
19072  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19073  if (__pyx_t_1) {
19074 
19075  /* "View.MemoryView":1193
19076  *
19077  * if order == 'F':
19078  * for idx in range(ndim): # <<<<<<<<<<<<<<
19079  * strides[idx] = stride
19080  * stride = stride * shape[idx]
19081  */
19082  __pyx_t_2 = __pyx_v_ndim;
19083  __pyx_t_3 = __pyx_t_2;
19084  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19085  __pyx_v_idx = __pyx_t_4;
19086 
19087  /* "View.MemoryView":1194
19088  * if order == 'F':
19089  * for idx in range(ndim):
19090  * strides[idx] = stride # <<<<<<<<<<<<<<
19091  * stride = stride * shape[idx]
19092  * else:
19093  */
19094  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19095 
19096  /* "View.MemoryView":1195
19097  * for idx in range(ndim):
19098  * strides[idx] = stride
19099  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
19100  * else:
19101  * for idx in range(ndim - 1, -1, -1):
19102  */
19103  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19104  }
19105 
19106  /* "View.MemoryView":1192
19107  * cdef int idx
19108  *
19109  * if order == 'F': # <<<<<<<<<<<<<<
19110  * for idx in range(ndim):
19111  * strides[idx] = stride
19112  */
19113  goto __pyx_L3;
19114  }
19115 
19116  /* "View.MemoryView":1197
19117  * stride = stride * shape[idx]
19118  * else:
19119  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19120  * strides[idx] = stride
19121  * stride = stride * shape[idx]
19122  */
19123  /*else*/ {
19124  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19125  __pyx_v_idx = __pyx_t_2;
19126 
19127  /* "View.MemoryView":1198
19128  * else:
19129  * for idx in range(ndim - 1, -1, -1):
19130  * strides[idx] = stride # <<<<<<<<<<<<<<
19131  * stride = stride * shape[idx]
19132  *
19133  */
19134  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19135 
19136  /* "View.MemoryView":1199
19137  * for idx in range(ndim - 1, -1, -1):
19138  * strides[idx] = stride
19139  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
19140  *
19141  * return stride
19142  */
19143  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19144  }
19145  }
19146  __pyx_L3:;
19147 
19148  /* "View.MemoryView":1201
19149  * stride = stride * shape[idx]
19150  *
19151  * return stride # <<<<<<<<<<<<<<
19152  *
19153  * @cname('__pyx_memoryview_copy_data_to_temp')
19154  */
19155  __pyx_r = __pyx_v_stride;
19156  goto __pyx_L0;
19157 
19158  /* "View.MemoryView":1183
19159  *
19160  * @cname('__pyx_fill_contig_strides_array')
19161  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19162  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19163  * int ndim, char order) nogil:
19164  */
19165 
19166  /* function exit code */
19167  __pyx_L0:;
19168  return __pyx_r;
19169 }
19170 
19171 /* "View.MemoryView":1204
19172  *
19173  * @cname('__pyx_memoryview_copy_data_to_temp')
19174  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19175  * __Pyx_memviewslice *tmpslice,
19176  * char order,
19177  */
19178 
19179 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19180  int __pyx_v_i;
19181  void *__pyx_v_result;
19182  size_t __pyx_v_itemsize;
19183  size_t __pyx_v_size;
19184  void *__pyx_r;
19185  Py_ssize_t __pyx_t_1;
19186  int __pyx_t_2;
19187  int __pyx_t_3;
19188  struct __pyx_memoryview_obj *__pyx_t_4;
19189  int __pyx_t_5;
19190  int __pyx_t_6;
19191 
19192  /* "View.MemoryView":1215
19193  * cdef void *result
19194  *
19195  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19196  * cdef size_t size = slice_get_size(src, ndim)
19197  *
19198  */
19199  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19200  __pyx_v_itemsize = __pyx_t_1;
19201 
19202  /* "View.MemoryView":1216
19203  *
19204  * cdef size_t itemsize = src.memview.view.itemsize
19205  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19206  *
19207  * result = malloc(size)
19208  */
19209  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19210 
19211  /* "View.MemoryView":1218
19212  * cdef size_t size = slice_get_size(src, ndim)
19213  *
19214  * result = malloc(size) # <<<<<<<<<<<<<<
19215  * if not result:
19216  * _err(MemoryError, NULL)
19217  */
19218  __pyx_v_result = malloc(__pyx_v_size);
19219 
19220  /* "View.MemoryView":1219
19221  *
19222  * result = malloc(size)
19223  * if not result: # <<<<<<<<<<<<<<
19224  * _err(MemoryError, NULL)
19225  *
19226  */
19227  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19228  if (__pyx_t_2) {
19229 
19230  /* "View.MemoryView":1220
19231  * result = malloc(size)
19232  * if not result:
19233  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19234  *
19235  *
19236  */
19237  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
19238 
19239  /* "View.MemoryView":1219
19240  *
19241  * result = malloc(size)
19242  * if not result: # <<<<<<<<<<<<<<
19243  * _err(MemoryError, NULL)
19244  *
19245  */
19246  }
19247 
19248  /* "View.MemoryView":1223
19249  *
19250  *
19251  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19252  * tmpslice.memview = src.memview
19253  * for i in range(ndim):
19254  */
19255  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19256 
19257  /* "View.MemoryView":1224
19258  *
19259  * tmpslice.data = <char *> result
19260  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19261  * for i in range(ndim):
19262  * tmpslice.shape[i] = src.shape[i]
19263  */
19264  __pyx_t_4 = __pyx_v_src->memview;
19265  __pyx_v_tmpslice->memview = __pyx_t_4;
19266 
19267  /* "View.MemoryView":1225
19268  * tmpslice.data = <char *> result
19269  * tmpslice.memview = src.memview
19270  * for i in range(ndim): # <<<<<<<<<<<<<<
19271  * tmpslice.shape[i] = src.shape[i]
19272  * tmpslice.suboffsets[i] = -1
19273  */
19274  __pyx_t_3 = __pyx_v_ndim;
19275  __pyx_t_5 = __pyx_t_3;
19276  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19277  __pyx_v_i = __pyx_t_6;
19278 
19279  /* "View.MemoryView":1226
19280  * tmpslice.memview = src.memview
19281  * for i in range(ndim):
19282  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19283  * tmpslice.suboffsets[i] = -1
19284  *
19285  */
19286  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19287 
19288  /* "View.MemoryView":1227
19289  * for i in range(ndim):
19290  * tmpslice.shape[i] = src.shape[i]
19291  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19292  *
19293  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19294  */
19295  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19296  }
19297 
19298  /* "View.MemoryView":1229
19299  * tmpslice.suboffsets[i] = -1
19300  *
19301  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19302  * ndim, order)
19303  *
19304  */
19305  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19306 
19307  /* "View.MemoryView":1233
19308  *
19309  *
19310  * for i in range(ndim): # <<<<<<<<<<<<<<
19311  * if tmpslice.shape[i] == 1:
19312  * tmpslice.strides[i] = 0
19313  */
19314  __pyx_t_3 = __pyx_v_ndim;
19315  __pyx_t_5 = __pyx_t_3;
19316  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19317  __pyx_v_i = __pyx_t_6;
19318 
19319  /* "View.MemoryView":1234
19320  *
19321  * for i in range(ndim):
19322  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19323  * tmpslice.strides[i] = 0
19324  *
19325  */
19326  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19327  if (__pyx_t_2) {
19328 
19329  /* "View.MemoryView":1235
19330  * for i in range(ndim):
19331  * if tmpslice.shape[i] == 1:
19332  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19333  *
19334  * if slice_is_contig(src[0], order, ndim):
19335  */
19336  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19337 
19338  /* "View.MemoryView":1234
19339  *
19340  * for i in range(ndim):
19341  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19342  * tmpslice.strides[i] = 0
19343  *
19344  */
19345  }
19346  }
19347 
19348  /* "View.MemoryView":1237
19349  * tmpslice.strides[i] = 0
19350  *
19351  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19352  * memcpy(result, src.data, size)
19353  * else:
19354  */
19355  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19356  if (__pyx_t_2) {
19357 
19358  /* "View.MemoryView":1238
19359  *
19360  * if slice_is_contig(src[0], order, ndim):
19361  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19362  * else:
19363  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19364  */
19365  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19366 
19367  /* "View.MemoryView":1237
19368  * tmpslice.strides[i] = 0
19369  *
19370  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19371  * memcpy(result, src.data, size)
19372  * else:
19373  */
19374  goto __pyx_L9;
19375  }
19376 
19377  /* "View.MemoryView":1240
19378  * memcpy(result, src.data, size)
19379  * else:
19380  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19381  *
19382  * return result
19383  */
19384  /*else*/ {
19385  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19386  }
19387  __pyx_L9:;
19388 
19389  /* "View.MemoryView":1242
19390  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19391  *
19392  * return result # <<<<<<<<<<<<<<
19393  *
19394  *
19395  */
19396  __pyx_r = __pyx_v_result;
19397  goto __pyx_L0;
19398 
19399  /* "View.MemoryView":1204
19400  *
19401  * @cname('__pyx_memoryview_copy_data_to_temp')
19402  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19403  * __Pyx_memviewslice *tmpslice,
19404  * char order,
19405  */
19406 
19407  /* function exit code */
19408  __pyx_L1_error:;
19409  {
19410  #ifdef WITH_THREAD
19411  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19412  #endif
19413  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19414  #ifdef WITH_THREAD
19415  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19416  #endif
19417  }
19418  __pyx_r = NULL;
19419  __pyx_L0:;
19420  return __pyx_r;
19421 }
19422 
19423 /* "View.MemoryView":1247
19424  *
19425  * @cname('__pyx_memoryview_err_extents')
19426  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19427  * Py_ssize_t extent2) except -1 with gil:
19428  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19429  */
19430 
19431 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19432  int __pyx_r;
19433  __Pyx_RefNannyDeclarations
19434  PyObject *__pyx_t_1 = NULL;
19435  PyObject *__pyx_t_2 = NULL;
19436  PyObject *__pyx_t_3 = NULL;
19437  PyObject *__pyx_t_4 = NULL;
19438  #ifdef WITH_THREAD
19439  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19440  #endif
19441  __Pyx_RefNannySetupContext("_err_extents", 0);
19442 
19443  /* "View.MemoryView":1250
19444  * Py_ssize_t extent2) except -1 with gil:
19445  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19446  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19447  *
19448  * @cname('__pyx_memoryview_err_dim')
19449  */
19450  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1250, __pyx_L1_error)
19451  __Pyx_GOTREF(__pyx_t_1);
19452  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1250, __pyx_L1_error)
19453  __Pyx_GOTREF(__pyx_t_2);
19454  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
19455  __Pyx_GOTREF(__pyx_t_3);
19456  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
19457  __Pyx_GOTREF(__pyx_t_4);
19458  __Pyx_GIVEREF(__pyx_t_1);
19459  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19460  __Pyx_GIVEREF(__pyx_t_2);
19461  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19462  __Pyx_GIVEREF(__pyx_t_3);
19463  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19464  __pyx_t_1 = 0;
19465  __pyx_t_2 = 0;
19466  __pyx_t_3 = 0;
19467 
19468  /* "View.MemoryView":1249
19469  * cdef int _err_extents(int i, Py_ssize_t extent1,
19470  * Py_ssize_t extent2) except -1 with gil:
19471  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19472  * (i, extent1, extent2))
19473  *
19474  */
19475  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error)
19476  __Pyx_GOTREF(__pyx_t_3);
19477  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19478  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
19479  __Pyx_GOTREF(__pyx_t_4);
19480  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19481  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19482  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19483  __PYX_ERR(1, 1249, __pyx_L1_error)
19484 
19485  /* "View.MemoryView":1247
19486  *
19487  * @cname('__pyx_memoryview_err_extents')
19488  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19489  * Py_ssize_t extent2) except -1 with gil:
19490  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19491  */
19492 
19493  /* function exit code */
19494  __pyx_L1_error:;
19495  __Pyx_XDECREF(__pyx_t_1);
19496  __Pyx_XDECREF(__pyx_t_2);
19497  __Pyx_XDECREF(__pyx_t_3);
19498  __Pyx_XDECREF(__pyx_t_4);
19499  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19500  __pyx_r = -1;
19501  __Pyx_RefNannyFinishContext();
19502  #ifdef WITH_THREAD
19503  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19504  #endif
19505  return __pyx_r;
19506 }
19507 
19508 /* "View.MemoryView":1253
19509  *
19510  * @cname('__pyx_memoryview_err_dim')
19511  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19512  * raise error(msg.decode('ascii') % dim)
19513  *
19514  */
19515 
19516 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19517  int __pyx_r;
19518  __Pyx_RefNannyDeclarations
19519  PyObject *__pyx_t_1 = NULL;
19520  PyObject *__pyx_t_2 = NULL;
19521  PyObject *__pyx_t_3 = NULL;
19522  PyObject *__pyx_t_4 = NULL;
19523  PyObject *__pyx_t_5 = NULL;
19524  #ifdef WITH_THREAD
19525  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19526  #endif
19527  __Pyx_RefNannySetupContext("_err_dim", 0);
19528  __Pyx_INCREF(__pyx_v_error);
19529 
19530  /* "View.MemoryView":1254
19531  * @cname('__pyx_memoryview_err_dim')
19532  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19533  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19534  *
19535  * @cname('__pyx_memoryview_err')
19536  */
19537  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19538  __Pyx_GOTREF(__pyx_t_2);
19539  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19540  __Pyx_GOTREF(__pyx_t_3);
19541  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19542  __Pyx_GOTREF(__pyx_t_4);
19543  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19544  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19545  __Pyx_INCREF(__pyx_v_error);
19546  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19547  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19548  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19549  if (likely(__pyx_t_2)) {
19550  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19551  __Pyx_INCREF(__pyx_t_2);
19552  __Pyx_INCREF(function);
19553  __Pyx_DECREF_SET(__pyx_t_3, function);
19554  }
19555  }
19556  if (!__pyx_t_2) {
19557  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19558  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19559  __Pyx_GOTREF(__pyx_t_1);
19560  } else {
19561  #if CYTHON_FAST_PYCALL
19562  if (PyFunction_Check(__pyx_t_3)) {
19563  PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19564  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19565  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19566  __Pyx_GOTREF(__pyx_t_1);
19567  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19568  } else
19569  #endif
19570  #if CYTHON_FAST_PYCCALL
19571  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
19572  PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19573  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19574  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19575  __Pyx_GOTREF(__pyx_t_1);
19576  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19577  } else
19578  #endif
19579  {
19580  __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1254, __pyx_L1_error)
19581  __Pyx_GOTREF(__pyx_t_5);
19582  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
19583  __Pyx_GIVEREF(__pyx_t_4);
19584  PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
19585  __pyx_t_4 = 0;
19586  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19587  __Pyx_GOTREF(__pyx_t_1);
19588  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19589  }
19590  }
19591  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19592  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19593  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19594  __PYX_ERR(1, 1254, __pyx_L1_error)
19595 
19596  /* "View.MemoryView":1253
19597  *
19598  * @cname('__pyx_memoryview_err_dim')
19599  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19600  * raise error(msg.decode('ascii') % dim)
19601  *
19602  */
19603 
19604  /* function exit code */
19605  __pyx_L1_error:;
19606  __Pyx_XDECREF(__pyx_t_1);
19607  __Pyx_XDECREF(__pyx_t_2);
19608  __Pyx_XDECREF(__pyx_t_3);
19609  __Pyx_XDECREF(__pyx_t_4);
19610  __Pyx_XDECREF(__pyx_t_5);
19611  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19612  __pyx_r = -1;
19613  __Pyx_XDECREF(__pyx_v_error);
19614  __Pyx_RefNannyFinishContext();
19615  #ifdef WITH_THREAD
19616  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19617  #endif
19618  return __pyx_r;
19619 }
19620 
19621 /* "View.MemoryView":1257
19622  *
19623  * @cname('__pyx_memoryview_err')
19624  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19625  * if msg != NULL:
19626  * raise error(msg.decode('ascii'))
19627  */
19628 
19629 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19630  int __pyx_r;
19631  __Pyx_RefNannyDeclarations
19632  int __pyx_t_1;
19633  PyObject *__pyx_t_2 = NULL;
19634  PyObject *__pyx_t_3 = NULL;
19635  PyObject *__pyx_t_4 = NULL;
19636  PyObject *__pyx_t_5 = NULL;
19637  PyObject *__pyx_t_6 = NULL;
19638  #ifdef WITH_THREAD
19639  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19640  #endif
19641  __Pyx_RefNannySetupContext("_err", 0);
19642  __Pyx_INCREF(__pyx_v_error);
19643 
19644  /* "View.MemoryView":1258
19645  * @cname('__pyx_memoryview_err')
19646  * cdef int _err(object error, char *msg) except -1 with gil:
19647  * if msg != NULL: # <<<<<<<<<<<<<<
19648  * raise error(msg.decode('ascii'))
19649  * else:
19650  */
19651  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19652  if (unlikely(__pyx_t_1)) {
19653 
19654  /* "View.MemoryView":1259
19655  * cdef int _err(object error, char *msg) except -1 with gil:
19656  * if msg != NULL:
19657  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19658  * else:
19659  * raise error
19660  */
19661  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1259, __pyx_L1_error)
19662  __Pyx_GOTREF(__pyx_t_3);
19663  __Pyx_INCREF(__pyx_v_error);
19664  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19665  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19666  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19667  if (likely(__pyx_t_5)) {
19668  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19669  __Pyx_INCREF(__pyx_t_5);
19670  __Pyx_INCREF(function);
19671  __Pyx_DECREF_SET(__pyx_t_4, function);
19672  }
19673  }
19674  if (!__pyx_t_5) {
19675  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19676  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19677  __Pyx_GOTREF(__pyx_t_2);
19678  } else {
19679  #if CYTHON_FAST_PYCALL
19680  if (PyFunction_Check(__pyx_t_4)) {
19681  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19682  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19683  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19684  __Pyx_GOTREF(__pyx_t_2);
19685  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19686  } else
19687  #endif
19688  #if CYTHON_FAST_PYCCALL
19689  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
19690  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19691  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19692  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19693  __Pyx_GOTREF(__pyx_t_2);
19694  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19695  } else
19696  #endif
19697  {
19698  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1259, __pyx_L1_error)
19699  __Pyx_GOTREF(__pyx_t_6);
19700  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
19701  __Pyx_GIVEREF(__pyx_t_3);
19702  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
19703  __pyx_t_3 = 0;
19704  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19705  __Pyx_GOTREF(__pyx_t_2);
19706  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19707  }
19708  }
19709  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19710  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19711  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19712  __PYX_ERR(1, 1259, __pyx_L1_error)
19713 
19714  /* "View.MemoryView":1258
19715  * @cname('__pyx_memoryview_err')
19716  * cdef int _err(object error, char *msg) except -1 with gil:
19717  * if msg != NULL: # <<<<<<<<<<<<<<
19718  * raise error(msg.decode('ascii'))
19719  * else:
19720  */
19721  }
19722 
19723  /* "View.MemoryView":1261
19724  * raise error(msg.decode('ascii'))
19725  * else:
19726  * raise error # <<<<<<<<<<<<<<
19727  *
19728  * @cname('__pyx_memoryview_copy_contents')
19729  */
19730  /*else*/ {
19731  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19732  __PYX_ERR(1, 1261, __pyx_L1_error)
19733  }
19734 
19735  /* "View.MemoryView":1257
19736  *
19737  * @cname('__pyx_memoryview_err')
19738  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19739  * if msg != NULL:
19740  * raise error(msg.decode('ascii'))
19741  */
19742 
19743  /* function exit code */
19744  __pyx_L1_error:;
19745  __Pyx_XDECREF(__pyx_t_2);
19746  __Pyx_XDECREF(__pyx_t_3);
19747  __Pyx_XDECREF(__pyx_t_4);
19748  __Pyx_XDECREF(__pyx_t_5);
19749  __Pyx_XDECREF(__pyx_t_6);
19750  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19751  __pyx_r = -1;
19752  __Pyx_XDECREF(__pyx_v_error);
19753  __Pyx_RefNannyFinishContext();
19754  #ifdef WITH_THREAD
19755  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19756  #endif
19757  return __pyx_r;
19758 }
19759 
19760 /* "View.MemoryView":1264
19761  *
19762  * @cname('__pyx_memoryview_copy_contents')
19763  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19764  * __Pyx_memviewslice dst,
19765  * int src_ndim, int dst_ndim,
19766  */
19767 
19768 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19769  void *__pyx_v_tmpdata;
19770  size_t __pyx_v_itemsize;
19771  int __pyx_v_i;
19772  char __pyx_v_order;
19773  int __pyx_v_broadcasting;
19774  int __pyx_v_direct_copy;
19775  __Pyx_memviewslice __pyx_v_tmp;
19776  int __pyx_v_ndim;
19777  int __pyx_r;
19778  Py_ssize_t __pyx_t_1;
19779  int __pyx_t_2;
19780  int __pyx_t_3;
19781  int __pyx_t_4;
19782  int __pyx_t_5;
19783  int __pyx_t_6;
19784  void *__pyx_t_7;
19785  int __pyx_t_8;
19786 
19787  /* "View.MemoryView":1272
19788  * Check for overlapping memory and verify the shapes.
19789  * """
19790  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19791  * cdef size_t itemsize = src.memview.view.itemsize
19792  * cdef int i
19793  */
19794  __pyx_v_tmpdata = NULL;
19795 
19796  /* "View.MemoryView":1273
19797  * """
19798  * cdef void *tmpdata = NULL
19799  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19800  * cdef int i
19801  * cdef char order = get_best_order(&src, src_ndim)
19802  */
19803  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19804  __pyx_v_itemsize = __pyx_t_1;
19805 
19806  /* "View.MemoryView":1275
19807  * cdef size_t itemsize = src.memview.view.itemsize
19808  * cdef int i
19809  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19810  * cdef bint broadcasting = False
19811  * cdef bint direct_copy = False
19812  */
19813  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19814 
19815  /* "View.MemoryView":1276
19816  * cdef int i
19817  * cdef char order = get_best_order(&src, src_ndim)
19818  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19819  * cdef bint direct_copy = False
19820  * cdef __Pyx_memviewslice tmp
19821  */
19822  __pyx_v_broadcasting = 0;
19823 
19824  /* "View.MemoryView":1277
19825  * cdef char order = get_best_order(&src, src_ndim)
19826  * cdef bint broadcasting = False
19827  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19828  * cdef __Pyx_memviewslice tmp
19829  *
19830  */
19831  __pyx_v_direct_copy = 0;
19832 
19833  /* "View.MemoryView":1280
19834  * cdef __Pyx_memviewslice tmp
19835  *
19836  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19837  * broadcast_leading(&src, src_ndim, dst_ndim)
19838  * elif dst_ndim < src_ndim:
19839  */
19840  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19841  if (__pyx_t_2) {
19842 
19843  /* "View.MemoryView":1281
19844  *
19845  * if src_ndim < dst_ndim:
19846  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19847  * elif dst_ndim < src_ndim:
19848  * broadcast_leading(&dst, dst_ndim, src_ndim)
19849  */
19850  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19851 
19852  /* "View.MemoryView":1280
19853  * cdef __Pyx_memviewslice tmp
19854  *
19855  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19856  * broadcast_leading(&src, src_ndim, dst_ndim)
19857  * elif dst_ndim < src_ndim:
19858  */
19859  goto __pyx_L3;
19860  }
19861 
19862  /* "View.MemoryView":1282
19863  * if src_ndim < dst_ndim:
19864  * broadcast_leading(&src, src_ndim, dst_ndim)
19865  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19866  * broadcast_leading(&dst, dst_ndim, src_ndim)
19867  *
19868  */
19869  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19870  if (__pyx_t_2) {
19871 
19872  /* "View.MemoryView":1283
19873  * broadcast_leading(&src, src_ndim, dst_ndim)
19874  * elif dst_ndim < src_ndim:
19875  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19876  *
19877  * cdef int ndim = max(src_ndim, dst_ndim)
19878  */
19879  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19880 
19881  /* "View.MemoryView":1282
19882  * if src_ndim < dst_ndim:
19883  * broadcast_leading(&src, src_ndim, dst_ndim)
19884  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19885  * broadcast_leading(&dst, dst_ndim, src_ndim)
19886  *
19887  */
19888  }
19889  __pyx_L3:;
19890 
19891  /* "View.MemoryView":1285
19892  * broadcast_leading(&dst, dst_ndim, src_ndim)
19893  *
19894  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19895  *
19896  * for i in range(ndim):
19897  */
19898  __pyx_t_3 = __pyx_v_dst_ndim;
19899  __pyx_t_4 = __pyx_v_src_ndim;
19900  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19901  __pyx_t_5 = __pyx_t_3;
19902  } else {
19903  __pyx_t_5 = __pyx_t_4;
19904  }
19905  __pyx_v_ndim = __pyx_t_5;
19906 
19907  /* "View.MemoryView":1287
19908  * cdef int ndim = max(src_ndim, dst_ndim)
19909  *
19910  * for i in range(ndim): # <<<<<<<<<<<<<<
19911  * if src.shape[i] != dst.shape[i]:
19912  * if src.shape[i] == 1:
19913  */
19914  __pyx_t_5 = __pyx_v_ndim;
19915  __pyx_t_3 = __pyx_t_5;
19916  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19917  __pyx_v_i = __pyx_t_4;
19918 
19919  /* "View.MemoryView":1288
19920  *
19921  * for i in range(ndim):
19922  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19923  * if src.shape[i] == 1:
19924  * broadcasting = True
19925  */
19926  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19927  if (__pyx_t_2) {
19928 
19929  /* "View.MemoryView":1289
19930  * for i in range(ndim):
19931  * if src.shape[i] != dst.shape[i]:
19932  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19933  * broadcasting = True
19934  * src.strides[i] = 0
19935  */
19936  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19937  if (__pyx_t_2) {
19938 
19939  /* "View.MemoryView":1290
19940  * if src.shape[i] != dst.shape[i]:
19941  * if src.shape[i] == 1:
19942  * broadcasting = True # <<<<<<<<<<<<<<
19943  * src.strides[i] = 0
19944  * else:
19945  */
19946  __pyx_v_broadcasting = 1;
19947 
19948  /* "View.MemoryView":1291
19949  * if src.shape[i] == 1:
19950  * broadcasting = True
19951  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19952  * else:
19953  * _err_extents(i, dst.shape[i], src.shape[i])
19954  */
19955  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19956 
19957  /* "View.MemoryView":1289
19958  * for i in range(ndim):
19959  * if src.shape[i] != dst.shape[i]:
19960  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19961  * broadcasting = True
19962  * src.strides[i] = 0
19963  */
19964  goto __pyx_L7;
19965  }
19966 
19967  /* "View.MemoryView":1293
19968  * src.strides[i] = 0
19969  * else:
19970  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19971  *
19972  * if src.suboffsets[i] >= 0:
19973  */
19974  /*else*/ {
19975  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1293, __pyx_L1_error)
19976  }
19977  __pyx_L7:;
19978 
19979  /* "View.MemoryView":1288
19980  *
19981  * for i in range(ndim):
19982  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19983  * if src.shape[i] == 1:
19984  * broadcasting = True
19985  */
19986  }
19987 
19988  /* "View.MemoryView":1295
19989  * _err_extents(i, dst.shape[i], src.shape[i])
19990  *
19991  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19992  * _err_dim(ValueError, "Dimension %d is not direct", i)
19993  *
19994  */
19995  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19996  if (__pyx_t_2) {
19997 
19998  /* "View.MemoryView":1296
19999  *
20000  * if src.suboffsets[i] >= 0:
20001  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20002  *
20003  * if slices_overlap(&src, &dst, ndim, itemsize):
20004  */
20005  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1296, __pyx_L1_error)
20006 
20007  /* "View.MemoryView":1295
20008  * _err_extents(i, dst.shape[i], src.shape[i])
20009  *
20010  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20011  * _err_dim(ValueError, "Dimension %d is not direct", i)
20012  *
20013  */
20014  }
20015  }
20016 
20017  /* "View.MemoryView":1298
20018  * _err_dim(ValueError, "Dimension %d is not direct", i)
20019  *
20020  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20021  *
20022  * if not slice_is_contig(src, order, ndim):
20023  */
20024  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20025  if (__pyx_t_2) {
20026 
20027  /* "View.MemoryView":1300
20028  * if slices_overlap(&src, &dst, ndim, itemsize):
20029  *
20030  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20031  * order = get_best_order(&dst, ndim)
20032  *
20033  */
20034  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20035  if (__pyx_t_2) {
20036 
20037  /* "View.MemoryView":1301
20038  *
20039  * if not slice_is_contig(src, order, ndim):
20040  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20041  *
20042  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20043  */
20044  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20045 
20046  /* "View.MemoryView":1300
20047  * if slices_overlap(&src, &dst, ndim, itemsize):
20048  *
20049  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20050  * order = get_best_order(&dst, ndim)
20051  *
20052  */
20053  }
20054 
20055  /* "View.MemoryView":1303
20056  * order = get_best_order(&dst, ndim)
20057  *
20058  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20059  * src = tmp
20060  *
20061  */
20062  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1303, __pyx_L1_error)
20063  __pyx_v_tmpdata = __pyx_t_7;
20064 
20065  /* "View.MemoryView":1304
20066  *
20067  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20068  * src = tmp # <<<<<<<<<<<<<<
20069  *
20070  * if not broadcasting:
20071  */
20072  __pyx_v_src = __pyx_v_tmp;
20073 
20074  /* "View.MemoryView":1298
20075  * _err_dim(ValueError, "Dimension %d is not direct", i)
20076  *
20077  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20078  *
20079  * if not slice_is_contig(src, order, ndim):
20080  */
20081  }
20082 
20083  /* "View.MemoryView":1306
20084  * src = tmp
20085  *
20086  * if not broadcasting: # <<<<<<<<<<<<<<
20087  *
20088  *
20089  */
20090  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20091  if (__pyx_t_2) {
20092 
20093  /* "View.MemoryView":1309
20094  *
20095  *
20096  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20097  * direct_copy = slice_is_contig(dst, 'C', ndim)
20098  * elif slice_is_contig(src, 'F', ndim):
20099  */
20100  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20101  if (__pyx_t_2) {
20102 
20103  /* "View.MemoryView":1310
20104  *
20105  * if slice_is_contig(src, 'C', ndim):
20106  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20107  * elif slice_is_contig(src, 'F', ndim):
20108  * direct_copy = slice_is_contig(dst, 'F', ndim)
20109  */
20110  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20111 
20112  /* "View.MemoryView":1309
20113  *
20114  *
20115  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20116  * direct_copy = slice_is_contig(dst, 'C', ndim)
20117  * elif slice_is_contig(src, 'F', ndim):
20118  */
20119  goto __pyx_L12;
20120  }
20121 
20122  /* "View.MemoryView":1311
20123  * if slice_is_contig(src, 'C', ndim):
20124  * direct_copy = slice_is_contig(dst, 'C', ndim)
20125  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20126  * direct_copy = slice_is_contig(dst, 'F', ndim)
20127  *
20128  */
20129  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20130  if (__pyx_t_2) {
20131 
20132  /* "View.MemoryView":1312
20133  * direct_copy = slice_is_contig(dst, 'C', ndim)
20134  * elif slice_is_contig(src, 'F', ndim):
20135  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20136  *
20137  * if direct_copy:
20138  */
20139  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20140 
20141  /* "View.MemoryView":1311
20142  * if slice_is_contig(src, 'C', ndim):
20143  * direct_copy = slice_is_contig(dst, 'C', ndim)
20144  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20145  * direct_copy = slice_is_contig(dst, 'F', ndim)
20146  *
20147  */
20148  }
20149  __pyx_L12:;
20150 
20151  /* "View.MemoryView":1314
20152  * direct_copy = slice_is_contig(dst, 'F', ndim)
20153  *
20154  * if direct_copy: # <<<<<<<<<<<<<<
20155  *
20156  * refcount_copying(&dst, dtype_is_object, ndim, False)
20157  */
20158  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20159  if (__pyx_t_2) {
20160 
20161  /* "View.MemoryView":1316
20162  * if direct_copy:
20163  *
20164  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20165  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20166  * refcount_copying(&dst, dtype_is_object, ndim, True)
20167  */
20168  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20169 
20170  /* "View.MemoryView":1317
20171  *
20172  * refcount_copying(&dst, dtype_is_object, ndim, False)
20173  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20174  * refcount_copying(&dst, dtype_is_object, ndim, True)
20175  * free(tmpdata)
20176  */
20177  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20178 
20179  /* "View.MemoryView":1318
20180  * refcount_copying(&dst, dtype_is_object, ndim, False)
20181  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20182  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20183  * free(tmpdata)
20184  * return 0
20185  */
20186  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20187 
20188  /* "View.MemoryView":1319
20189  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20190  * refcount_copying(&dst, dtype_is_object, ndim, True)
20191  * free(tmpdata) # <<<<<<<<<<<<<<
20192  * return 0
20193  *
20194  */
20195  free(__pyx_v_tmpdata);
20196 
20197  /* "View.MemoryView":1320
20198  * refcount_copying(&dst, dtype_is_object, ndim, True)
20199  * free(tmpdata)
20200  * return 0 # <<<<<<<<<<<<<<
20201  *
20202  * if order == 'F' == get_best_order(&dst, ndim):
20203  */
20204  __pyx_r = 0;
20205  goto __pyx_L0;
20206 
20207  /* "View.MemoryView":1314
20208  * direct_copy = slice_is_contig(dst, 'F', ndim)
20209  *
20210  * if direct_copy: # <<<<<<<<<<<<<<
20211  *
20212  * refcount_copying(&dst, dtype_is_object, ndim, False)
20213  */
20214  }
20215 
20216  /* "View.MemoryView":1306
20217  * src = tmp
20218  *
20219  * if not broadcasting: # <<<<<<<<<<<<<<
20220  *
20221  *
20222  */
20223  }
20224 
20225  /* "View.MemoryView":1322
20226  * return 0
20227  *
20228  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20229  *
20230  *
20231  */
20232  __pyx_t_2 = (__pyx_v_order == 'F');
20233  if (__pyx_t_2) {
20234  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20235  }
20236  __pyx_t_8 = (__pyx_t_2 != 0);
20237  if (__pyx_t_8) {
20238 
20239  /* "View.MemoryView":1325
20240  *
20241  *
20242  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20243  * transpose_memslice(&dst)
20244  *
20245  */
20246  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1325, __pyx_L1_error)
20247 
20248  /* "View.MemoryView":1326
20249  *
20250  * transpose_memslice(&src)
20251  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20252  *
20253  * refcount_copying(&dst, dtype_is_object, ndim, False)
20254  */
20255  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
20256 
20257  /* "View.MemoryView":1322
20258  * return 0
20259  *
20260  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20261  *
20262  *
20263  */
20264  }
20265 
20266  /* "View.MemoryView":1328
20267  * transpose_memslice(&dst)
20268  *
20269  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20270  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20271  * refcount_copying(&dst, dtype_is_object, ndim, True)
20272  */
20273  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20274 
20275  /* "View.MemoryView":1329
20276  *
20277  * refcount_copying(&dst, dtype_is_object, ndim, False)
20278  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20279  * refcount_copying(&dst, dtype_is_object, ndim, True)
20280  *
20281  */
20282  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20283 
20284  /* "View.MemoryView":1330
20285  * refcount_copying(&dst, dtype_is_object, ndim, False)
20286  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20287  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20288  *
20289  * free(tmpdata)
20290  */
20291  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20292 
20293  /* "View.MemoryView":1332
20294  * refcount_copying(&dst, dtype_is_object, ndim, True)
20295  *
20296  * free(tmpdata) # <<<<<<<<<<<<<<
20297  * return 0
20298  *
20299  */
20300  free(__pyx_v_tmpdata);
20301 
20302  /* "View.MemoryView":1333
20303  *
20304  * free(tmpdata)
20305  * return 0 # <<<<<<<<<<<<<<
20306  *
20307  * @cname('__pyx_memoryview_broadcast_leading')
20308  */
20309  __pyx_r = 0;
20310  goto __pyx_L0;
20311 
20312  /* "View.MemoryView":1264
20313  *
20314  * @cname('__pyx_memoryview_copy_contents')
20315  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20316  * __Pyx_memviewslice dst,
20317  * int src_ndim, int dst_ndim,
20318  */
20319 
20320  /* function exit code */
20321  __pyx_L1_error:;
20322  {
20323  #ifdef WITH_THREAD
20324  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20325  #endif
20326  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20327  #ifdef WITH_THREAD
20328  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20329  #endif
20330  }
20331  __pyx_r = -1;
20332  __pyx_L0:;
20333  return __pyx_r;
20334 }
20335 
20336 /* "View.MemoryView":1336
20337  *
20338  * @cname('__pyx_memoryview_broadcast_leading')
20339  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20340  * int ndim,
20341  * int ndim_other) nogil:
20342  */
20343 
20344 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20345  int __pyx_v_i;
20346  int __pyx_v_offset;
20347  int __pyx_t_1;
20348  int __pyx_t_2;
20349  int __pyx_t_3;
20350 
20351  /* "View.MemoryView":1340
20352  * int ndim_other) nogil:
20353  * cdef int i
20354  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20355  *
20356  * for i in range(ndim - 1, -1, -1):
20357  */
20358  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20359 
20360  /* "View.MemoryView":1342
20361  * cdef int offset = ndim_other - ndim
20362  *
20363  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20364  * mslice.shape[i + offset] = mslice.shape[i]
20365  * mslice.strides[i + offset] = mslice.strides[i]
20366  */
20367  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20368  __pyx_v_i = __pyx_t_1;
20369 
20370  /* "View.MemoryView":1343
20371  *
20372  * for i in range(ndim - 1, -1, -1):
20373  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20374  * mslice.strides[i + offset] = mslice.strides[i]
20375  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20376  */
20377  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20378 
20379  /* "View.MemoryView":1344
20380  * for i in range(ndim - 1, -1, -1):
20381  * mslice.shape[i + offset] = mslice.shape[i]
20382  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20383  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20384  *
20385  */
20386  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20387 
20388  /* "View.MemoryView":1345
20389  * mslice.shape[i + offset] = mslice.shape[i]
20390  * mslice.strides[i + offset] = mslice.strides[i]
20391  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20392  *
20393  * for i in range(offset):
20394  */
20395  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20396  }
20397 
20398  /* "View.MemoryView":1347
20399  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20400  *
20401  * for i in range(offset): # <<<<<<<<<<<<<<
20402  * mslice.shape[i] = 1
20403  * mslice.strides[i] = mslice.strides[0]
20404  */
20405  __pyx_t_1 = __pyx_v_offset;
20406  __pyx_t_2 = __pyx_t_1;
20407  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20408  __pyx_v_i = __pyx_t_3;
20409 
20410  /* "View.MemoryView":1348
20411  *
20412  * for i in range(offset):
20413  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20414  * mslice.strides[i] = mslice.strides[0]
20415  * mslice.suboffsets[i] = -1
20416  */
20417  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20418 
20419  /* "View.MemoryView":1349
20420  * for i in range(offset):
20421  * mslice.shape[i] = 1
20422  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20423  * mslice.suboffsets[i] = -1
20424  *
20425  */
20426  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20427 
20428  /* "View.MemoryView":1350
20429  * mslice.shape[i] = 1
20430  * mslice.strides[i] = mslice.strides[0]
20431  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20432  *
20433  *
20434  */
20435  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20436  }
20437 
20438  /* "View.MemoryView":1336
20439  *
20440  * @cname('__pyx_memoryview_broadcast_leading')
20441  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20442  * int ndim,
20443  * int ndim_other) nogil:
20444  */
20445 
20446  /* function exit code */
20447 }
20448 
20449 /* "View.MemoryView":1358
20450  *
20451  * @cname('__pyx_memoryview_refcount_copying')
20452  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20453  * int ndim, bint inc) nogil:
20454  *
20455  */
20456 
20457 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20458  int __pyx_t_1;
20459 
20460  /* "View.MemoryView":1362
20461  *
20462  *
20463  * if dtype_is_object: # <<<<<<<<<<<<<<
20464  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20465  * dst.strides, ndim, inc)
20466  */
20467  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20468  if (__pyx_t_1) {
20469 
20470  /* "View.MemoryView":1363
20471  *
20472  * if dtype_is_object:
20473  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20474  * dst.strides, ndim, inc)
20475  *
20476  */
20477  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20478 
20479  /* "View.MemoryView":1362
20480  *
20481  *
20482  * if dtype_is_object: # <<<<<<<<<<<<<<
20483  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20484  * dst.strides, ndim, inc)
20485  */
20486  }
20487 
20488  /* "View.MemoryView":1358
20489  *
20490  * @cname('__pyx_memoryview_refcount_copying')
20491  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20492  * int ndim, bint inc) nogil:
20493  *
20494  */
20495 
20496  /* function exit code */
20497 }
20498 
20499 /* "View.MemoryView":1367
20500  *
20501  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20502  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20503  * Py_ssize_t *strides, int ndim,
20504  * bint inc) with gil:
20505  */
20506 
20507 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20508  __Pyx_RefNannyDeclarations
20509  #ifdef WITH_THREAD
20510  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20511  #endif
20512  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20513 
20514  /* "View.MemoryView":1370
20515  * Py_ssize_t *strides, int ndim,
20516  * bint inc) with gil:
20517  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20518  *
20519  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20520  */
20521  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20522 
20523  /* "View.MemoryView":1367
20524  *
20525  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20526  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20527  * Py_ssize_t *strides, int ndim,
20528  * bint inc) with gil:
20529  */
20530 
20531  /* function exit code */
20532  __Pyx_RefNannyFinishContext();
20533  #ifdef WITH_THREAD
20534  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20535  #endif
20536 }
20537 
20538 /* "View.MemoryView":1373
20539  *
20540  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20541  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20542  * Py_ssize_t *strides, int ndim, bint inc):
20543  * cdef Py_ssize_t i
20544  */
20545 
20546 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20547  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20548  __Pyx_RefNannyDeclarations
20549  Py_ssize_t __pyx_t_1;
20550  Py_ssize_t __pyx_t_2;
20551  Py_ssize_t __pyx_t_3;
20552  int __pyx_t_4;
20553  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20554 
20555  /* "View.MemoryView":1377
20556  * cdef Py_ssize_t i
20557  *
20558  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20559  * if ndim == 1:
20560  * if inc:
20561  */
20562  __pyx_t_1 = (__pyx_v_shape[0]);
20563  __pyx_t_2 = __pyx_t_1;
20564  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20565  __pyx_v_i = __pyx_t_3;
20566 
20567  /* "View.MemoryView":1378
20568  *
20569  * for i in range(shape[0]):
20570  * if ndim == 1: # <<<<<<<<<<<<<<
20571  * if inc:
20572  * Py_INCREF((<PyObject **> data)[0])
20573  */
20574  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20575  if (__pyx_t_4) {
20576 
20577  /* "View.MemoryView":1379
20578  * for i in range(shape[0]):
20579  * if ndim == 1:
20580  * if inc: # <<<<<<<<<<<<<<
20581  * Py_INCREF((<PyObject **> data)[0])
20582  * else:
20583  */
20584  __pyx_t_4 = (__pyx_v_inc != 0);
20585  if (__pyx_t_4) {
20586 
20587  /* "View.MemoryView":1380
20588  * if ndim == 1:
20589  * if inc:
20590  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20591  * else:
20592  * Py_DECREF((<PyObject **> data)[0])
20593  */
20594  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20595 
20596  /* "View.MemoryView":1379
20597  * for i in range(shape[0]):
20598  * if ndim == 1:
20599  * if inc: # <<<<<<<<<<<<<<
20600  * Py_INCREF((<PyObject **> data)[0])
20601  * else:
20602  */
20603  goto __pyx_L6;
20604  }
20605 
20606  /* "View.MemoryView":1382
20607  * Py_INCREF((<PyObject **> data)[0])
20608  * else:
20609  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20610  * else:
20611  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20612  */
20613  /*else*/ {
20614  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20615  }
20616  __pyx_L6:;
20617 
20618  /* "View.MemoryView":1378
20619  *
20620  * for i in range(shape[0]):
20621  * if ndim == 1: # <<<<<<<<<<<<<<
20622  * if inc:
20623  * Py_INCREF((<PyObject **> data)[0])
20624  */
20625  goto __pyx_L5;
20626  }
20627 
20628  /* "View.MemoryView":1384
20629  * Py_DECREF((<PyObject **> data)[0])
20630  * else:
20631  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20632  * ndim - 1, inc)
20633  *
20634  */
20635  /*else*/ {
20636 
20637  /* "View.MemoryView":1385
20638  * else:
20639  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20640  * ndim - 1, inc) # <<<<<<<<<<<<<<
20641  *
20642  * data += strides[0]
20643  */
20644  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20645  }
20646  __pyx_L5:;
20647 
20648  /* "View.MemoryView":1387
20649  * ndim - 1, inc)
20650  *
20651  * data += strides[0] # <<<<<<<<<<<<<<
20652  *
20653  *
20654  */
20655  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20656  }
20657 
20658  /* "View.MemoryView":1373
20659  *
20660  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20661  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20662  * Py_ssize_t *strides, int ndim, bint inc):
20663  * cdef Py_ssize_t i
20664  */
20665 
20666  /* function exit code */
20667  __Pyx_RefNannyFinishContext();
20668 }
20669 
20670 /* "View.MemoryView":1393
20671  *
20672  * @cname('__pyx_memoryview_slice_assign_scalar')
20673  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20674  * size_t itemsize, void *item,
20675  * bint dtype_is_object) nogil:
20676  */
20677 
20678 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20679 
20680  /* "View.MemoryView":1396
20681  * size_t itemsize, void *item,
20682  * bint dtype_is_object) nogil:
20683  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20684  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20685  * itemsize, item)
20686  */
20687  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20688 
20689  /* "View.MemoryView":1397
20690  * bint dtype_is_object) nogil:
20691  * refcount_copying(dst, dtype_is_object, ndim, False)
20692  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20693  * itemsize, item)
20694  * refcount_copying(dst, dtype_is_object, ndim, True)
20695  */
20696  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20697 
20698  /* "View.MemoryView":1399
20699  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20700  * itemsize, item)
20701  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20702  *
20703  *
20704  */
20705  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20706 
20707  /* "View.MemoryView":1393
20708  *
20709  * @cname('__pyx_memoryview_slice_assign_scalar')
20710  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20711  * size_t itemsize, void *item,
20712  * bint dtype_is_object) nogil:
20713  */
20714 
20715  /* function exit code */
20716 }
20717 
20718 /* "View.MemoryView":1403
20719  *
20720  * @cname('__pyx_memoryview__slice_assign_scalar')
20721  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20722  * Py_ssize_t *strides, int ndim,
20723  * size_t itemsize, void *item) nogil:
20724  */
20725 
20726 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20727  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20728  Py_ssize_t __pyx_v_stride;
20729  Py_ssize_t __pyx_v_extent;
20730  int __pyx_t_1;
20731  Py_ssize_t __pyx_t_2;
20732  Py_ssize_t __pyx_t_3;
20733  Py_ssize_t __pyx_t_4;
20734 
20735  /* "View.MemoryView":1407
20736  * size_t itemsize, void *item) nogil:
20737  * cdef Py_ssize_t i
20738  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20739  * cdef Py_ssize_t extent = shape[0]
20740  *
20741  */
20742  __pyx_v_stride = (__pyx_v_strides[0]);
20743 
20744  /* "View.MemoryView":1408
20745  * cdef Py_ssize_t i
20746  * cdef Py_ssize_t stride = strides[0]
20747  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20748  *
20749  * if ndim == 1:
20750  */
20751  __pyx_v_extent = (__pyx_v_shape[0]);
20752 
20753  /* "View.MemoryView":1410
20754  * cdef Py_ssize_t extent = shape[0]
20755  *
20756  * if ndim == 1: # <<<<<<<<<<<<<<
20757  * for i in range(extent):
20758  * memcpy(data, item, itemsize)
20759  */
20760  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20761  if (__pyx_t_1) {
20762 
20763  /* "View.MemoryView":1411
20764  *
20765  * if ndim == 1:
20766  * for i in range(extent): # <<<<<<<<<<<<<<
20767  * memcpy(data, item, itemsize)
20768  * data += stride
20769  */
20770  __pyx_t_2 = __pyx_v_extent;
20771  __pyx_t_3 = __pyx_t_2;
20772  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20773  __pyx_v_i = __pyx_t_4;
20774 
20775  /* "View.MemoryView":1412
20776  * if ndim == 1:
20777  * for i in range(extent):
20778  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20779  * data += stride
20780  * else:
20781  */
20782  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20783 
20784  /* "View.MemoryView":1413
20785  * for i in range(extent):
20786  * memcpy(data, item, itemsize)
20787  * data += stride # <<<<<<<<<<<<<<
20788  * else:
20789  * for i in range(extent):
20790  */
20791  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20792  }
20793 
20794  /* "View.MemoryView":1410
20795  * cdef Py_ssize_t extent = shape[0]
20796  *
20797  * if ndim == 1: # <<<<<<<<<<<<<<
20798  * for i in range(extent):
20799  * memcpy(data, item, itemsize)
20800  */
20801  goto __pyx_L3;
20802  }
20803 
20804  /* "View.MemoryView":1415
20805  * data += stride
20806  * else:
20807  * for i in range(extent): # <<<<<<<<<<<<<<
20808  * _slice_assign_scalar(data, shape + 1, strides + 1,
20809  * ndim - 1, itemsize, item)
20810  */
20811  /*else*/ {
20812  __pyx_t_2 = __pyx_v_extent;
20813  __pyx_t_3 = __pyx_t_2;
20814  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20815  __pyx_v_i = __pyx_t_4;
20816 
20817  /* "View.MemoryView":1416
20818  * else:
20819  * for i in range(extent):
20820  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20821  * ndim - 1, itemsize, item)
20822  * data += stride
20823  */
20824  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20825 
20826  /* "View.MemoryView":1418
20827  * _slice_assign_scalar(data, shape + 1, strides + 1,
20828  * ndim - 1, itemsize, item)
20829  * data += stride # <<<<<<<<<<<<<<
20830  *
20831  *
20832  */
20833  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20834  }
20835  }
20836  __pyx_L3:;
20837 
20838  /* "View.MemoryView":1403
20839  *
20840  * @cname('__pyx_memoryview__slice_assign_scalar')
20841  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20842  * Py_ssize_t *strides, int ndim,
20843  * size_t itemsize, void *item) nogil:
20844  */
20845 
20846  /* function exit code */
20847 }
20848 
20849 /* "(tree fragment)":1
20850  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20851  * if __pyx_checksum != 0xb068931:
20852  * from pickle import PickleError as __pyx_PickleError
20853  */
20854 
20855 /* Python wrapper */
20856 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20857 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20858 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20859  PyObject *__pyx_v___pyx_type = 0;
20860  long __pyx_v___pyx_checksum;
20861  PyObject *__pyx_v___pyx_state = 0;
20862  PyObject *__pyx_r = 0;
20863  __Pyx_RefNannyDeclarations
20864  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20865  {
20866  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20867  PyObject* values[3] = {0,0,0};
20868  if (unlikely(__pyx_kwds)) {
20869  Py_ssize_t kw_args;
20870  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20871  switch (pos_args) {
20872  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20873  CYTHON_FALLTHROUGH;
20874  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20875  CYTHON_FALLTHROUGH;
20876  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20877  CYTHON_FALLTHROUGH;
20878  case 0: break;
20879  default: goto __pyx_L5_argtuple_error;
20880  }
20881  kw_args = PyDict_Size(__pyx_kwds);
20882  switch (pos_args) {
20883  case 0:
20884  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20885  else goto __pyx_L5_argtuple_error;
20886  CYTHON_FALLTHROUGH;
20887  case 1:
20888  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20889  else {
20890  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20891  }
20892  CYTHON_FALLTHROUGH;
20893  case 2:
20894  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20895  else {
20896  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20897  }
20898  }
20899  if (unlikely(kw_args > 0)) {
20900  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20901  }
20902  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20903  goto __pyx_L5_argtuple_error;
20904  } else {
20905  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20906  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20907  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20908  }
20909  __pyx_v___pyx_type = values[0];
20910  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20911  __pyx_v___pyx_state = values[2];
20912  }
20913  goto __pyx_L4_argument_unpacking_done;
20914  __pyx_L5_argtuple_error:;
20915  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20916  __pyx_L3_error:;
20917  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20918  __Pyx_RefNannyFinishContext();
20919  return NULL;
20920  __pyx_L4_argument_unpacking_done:;
20921  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20922 
20923  /* function exit code */
20924  __Pyx_RefNannyFinishContext();
20925  return __pyx_r;
20926 }
20927 
20928 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20929  PyObject *__pyx_v___pyx_PickleError = NULL;
20930  PyObject *__pyx_v___pyx_result = NULL;
20931  PyObject *__pyx_r = NULL;
20932  __Pyx_RefNannyDeclarations
20933  int __pyx_t_1;
20934  PyObject *__pyx_t_2 = NULL;
20935  PyObject *__pyx_t_3 = NULL;
20936  PyObject *__pyx_t_4 = NULL;
20937  PyObject *__pyx_t_5 = NULL;
20938  PyObject *__pyx_t_6 = NULL;
20939  int __pyx_t_7;
20940  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20941 
20942  /* "(tree fragment)":2
20943  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
20944  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20945  * from pickle import PickleError as __pyx_PickleError
20946  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20947  */
20948  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20949  if (__pyx_t_1) {
20950 
20951  /* "(tree fragment)":3
20952  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
20953  * if __pyx_checksum != 0xb068931:
20954  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20955  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20956  * __pyx_result = Enum.__new__(__pyx_type)
20957  */
20958  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
20959  __Pyx_GOTREF(__pyx_t_2);
20960  __Pyx_INCREF(__pyx_n_s_PickleError);
20961  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20962  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20963  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
20964  __Pyx_GOTREF(__pyx_t_3);
20965  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20966  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
20967  __Pyx_GOTREF(__pyx_t_2);
20968  __Pyx_INCREF(__pyx_t_2);
20969  __pyx_v___pyx_PickleError = __pyx_t_2;
20970  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20971  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20972 
20973  /* "(tree fragment)":4
20974  * if __pyx_checksum != 0xb068931:
20975  * from pickle import PickleError as __pyx_PickleError
20976  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20977  * __pyx_result = Enum.__new__(__pyx_type)
20978  * if __pyx_state is not None:
20979  */
20980  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
20981  __Pyx_GOTREF(__pyx_t_2);
20982  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
20983  __Pyx_GOTREF(__pyx_t_4);
20984  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20985  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20986  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20987  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20988  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20989  if (likely(__pyx_t_5)) {
20990  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20991  __Pyx_INCREF(__pyx_t_5);
20992  __Pyx_INCREF(function);
20993  __Pyx_DECREF_SET(__pyx_t_2, function);
20994  }
20995  }
20996  if (!__pyx_t_5) {
20997  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20998  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20999  __Pyx_GOTREF(__pyx_t_3);
21000  } else {
21001  #if CYTHON_FAST_PYCALL
21002  if (PyFunction_Check(__pyx_t_2)) {
21003  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
21004  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21005  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21006  __Pyx_GOTREF(__pyx_t_3);
21007  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21008  } else
21009  #endif
21010  #if CYTHON_FAST_PYCCALL
21011  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
21012  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
21013  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21014  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21015  __Pyx_GOTREF(__pyx_t_3);
21016  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21017  } else
21018  #endif
21019  {
21020  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
21021  __Pyx_GOTREF(__pyx_t_6);
21022  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
21023  __Pyx_GIVEREF(__pyx_t_4);
21024  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
21025  __pyx_t_4 = 0;
21026  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21027  __Pyx_GOTREF(__pyx_t_3);
21028  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21029  }
21030  }
21031  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21032  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21033  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21034  __PYX_ERR(1, 4, __pyx_L1_error)
21035 
21036  /* "(tree fragment)":2
21037  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
21038  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21039  * from pickle import PickleError as __pyx_PickleError
21040  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21041  */
21042  }
21043 
21044  /* "(tree fragment)":5
21045  * from pickle import PickleError as __pyx_PickleError
21046  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21047  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21048  * if __pyx_state is not None:
21049  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21050  */
21051  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21052  __Pyx_GOTREF(__pyx_t_2);
21053  __pyx_t_6 = NULL;
21054  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21055  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
21056  if (likely(__pyx_t_6)) {
21057  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21058  __Pyx_INCREF(__pyx_t_6);
21059  __Pyx_INCREF(function);
21060  __Pyx_DECREF_SET(__pyx_t_2, function);
21061  }
21062  }
21063  if (!__pyx_t_6) {
21064  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21065  __Pyx_GOTREF(__pyx_t_3);
21066  } else {
21067  #if CYTHON_FAST_PYCALL
21068  if (PyFunction_Check(__pyx_t_2)) {
21069  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
21070  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21071  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21072  __Pyx_GOTREF(__pyx_t_3);
21073  } else
21074  #endif
21075  #if CYTHON_FAST_PYCCALL
21076  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
21077  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
21078  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21079  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21080  __Pyx_GOTREF(__pyx_t_3);
21081  } else
21082  #endif
21083  {
21084  __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
21085  __Pyx_GOTREF(__pyx_t_4);
21086  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
21087  __Pyx_INCREF(__pyx_v___pyx_type);
21088  __Pyx_GIVEREF(__pyx_v___pyx_type);
21089  PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
21090  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21091  __Pyx_GOTREF(__pyx_t_3);
21092  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21093  }
21094  }
21095  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21096  __pyx_v___pyx_result = __pyx_t_3;
21097  __pyx_t_3 = 0;
21098 
21099  /* "(tree fragment)":6
21100  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21101  * __pyx_result = Enum.__new__(__pyx_type)
21102  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21103  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21104  * return __pyx_result
21105  */
21106  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21107  __pyx_t_7 = (__pyx_t_1 != 0);
21108  if (__pyx_t_7) {
21109 
21110  /* "(tree fragment)":7
21111  * __pyx_result = Enum.__new__(__pyx_type)
21112  * if __pyx_state is not None:
21113  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21114  * return __pyx_result
21115  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21116  */
21117  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
21118  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21119  __Pyx_GOTREF(__pyx_t_3);
21120  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21121 
21122  /* "(tree fragment)":6
21123  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21124  * __pyx_result = Enum.__new__(__pyx_type)
21125  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21126  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21127  * return __pyx_result
21128  */
21129  }
21130 
21131  /* "(tree fragment)":8
21132  * if __pyx_state is not None:
21133  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21134  * return __pyx_result # <<<<<<<<<<<<<<
21135  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21136  * __pyx_result.name = __pyx_state[0]
21137  */
21138  __Pyx_XDECREF(__pyx_r);
21139  __Pyx_INCREF(__pyx_v___pyx_result);
21140  __pyx_r = __pyx_v___pyx_result;
21141  goto __pyx_L0;
21142 
21143  /* "(tree fragment)":1
21144  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21145  * if __pyx_checksum != 0xb068931:
21146  * from pickle import PickleError as __pyx_PickleError
21147  */
21148 
21149  /* function exit code */
21150  __pyx_L1_error:;
21151  __Pyx_XDECREF(__pyx_t_2);
21152  __Pyx_XDECREF(__pyx_t_3);
21153  __Pyx_XDECREF(__pyx_t_4);
21154  __Pyx_XDECREF(__pyx_t_5);
21155  __Pyx_XDECREF(__pyx_t_6);
21156  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21157  __pyx_r = NULL;
21158  __pyx_L0:;
21159  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21160  __Pyx_XDECREF(__pyx_v___pyx_result);
21161  __Pyx_XGIVEREF(__pyx_r);
21162  __Pyx_RefNannyFinishContext();
21163  return __pyx_r;
21164 }
21165 
21166 /* "(tree fragment)":9
21167  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21168  * return __pyx_result
21169  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21170  * __pyx_result.name = __pyx_state[0]
21171  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21172  */
21173 
21174 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21175  PyObject *__pyx_r = NULL;
21176  __Pyx_RefNannyDeclarations
21177  PyObject *__pyx_t_1 = NULL;
21178  int __pyx_t_2;
21179  Py_ssize_t __pyx_t_3;
21180  int __pyx_t_4;
21181  int __pyx_t_5;
21182  PyObject *__pyx_t_6 = NULL;
21183  PyObject *__pyx_t_7 = NULL;
21184  PyObject *__pyx_t_8 = NULL;
21185  PyObject *__pyx_t_9 = NULL;
21186  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21187 
21188  /* "(tree fragment)":10
21189  * return __pyx_result
21190  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21191  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21192  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21193  * __pyx_result.__dict__.update(__pyx_state[1])
21194  */
21195  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21196  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21197  __PYX_ERR(1, 10, __pyx_L1_error)
21198  }
21199  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
21200  __Pyx_GOTREF(__pyx_t_1);
21201  __Pyx_GIVEREF(__pyx_t_1);
21202  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21203  __Pyx_DECREF(__pyx_v___pyx_result->name);
21204  __pyx_v___pyx_result->name = __pyx_t_1;
21205  __pyx_t_1 = 0;
21206 
21207  /* "(tree fragment)":11
21208  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21209  * __pyx_result.name = __pyx_state[0]
21210  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21211  * __pyx_result.__dict__.update(__pyx_state[1])
21212  */
21213  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21214  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21215  __PYX_ERR(1, 11, __pyx_L1_error)
21216  }
21217  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
21218  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21219  if (__pyx_t_4) {
21220  } else {
21221  __pyx_t_2 = __pyx_t_4;
21222  goto __pyx_L4_bool_binop_done;
21223  }
21224  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
21225  __pyx_t_5 = (__pyx_t_4 != 0);
21226  __pyx_t_2 = __pyx_t_5;
21227  __pyx_L4_bool_binop_done:;
21228  if (__pyx_t_2) {
21229 
21230  /* "(tree fragment)":12
21231  * __pyx_result.name = __pyx_state[0]
21232  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21233  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21234  */
21235  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
21236  __Pyx_GOTREF(__pyx_t_6);
21237  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error)
21238  __Pyx_GOTREF(__pyx_t_7);
21239  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21240  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21241  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21242  __PYX_ERR(1, 12, __pyx_L1_error)
21243  }
21244  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
21245  __Pyx_GOTREF(__pyx_t_6);
21246  __pyx_t_8 = NULL;
21247  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21248  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21249  if (likely(__pyx_t_8)) {
21250  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21251  __Pyx_INCREF(__pyx_t_8);
21252  __Pyx_INCREF(function);
21253  __Pyx_DECREF_SET(__pyx_t_7, function);
21254  }
21255  }
21256  if (!__pyx_t_8) {
21257  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21258  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21259  __Pyx_GOTREF(__pyx_t_1);
21260  } else {
21261  #if CYTHON_FAST_PYCALL
21262  if (PyFunction_Check(__pyx_t_7)) {
21263  PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
21264  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21265  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21266  __Pyx_GOTREF(__pyx_t_1);
21267  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21268  } else
21269  #endif
21270  #if CYTHON_FAST_PYCCALL
21271  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
21272  PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
21273  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21274  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21275  __Pyx_GOTREF(__pyx_t_1);
21276  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21277  } else
21278  #endif
21279  {
21280  __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
21281  __Pyx_GOTREF(__pyx_t_9);
21282  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
21283  __Pyx_GIVEREF(__pyx_t_6);
21284  PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
21285  __pyx_t_6 = 0;
21286  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21287  __Pyx_GOTREF(__pyx_t_1);
21288  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21289  }
21290  }
21291  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21292  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21293 
21294  /* "(tree fragment)":11
21295  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21296  * __pyx_result.name = __pyx_state[0]
21297  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21298  * __pyx_result.__dict__.update(__pyx_state[1])
21299  */
21300  }
21301 
21302  /* "(tree fragment)":9
21303  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21304  * return __pyx_result
21305  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21306  * __pyx_result.name = __pyx_state[0]
21307  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21308  */
21309 
21310  /* function exit code */
21311  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21312  goto __pyx_L0;
21313  __pyx_L1_error:;
21314  __Pyx_XDECREF(__pyx_t_1);
21315  __Pyx_XDECREF(__pyx_t_6);
21316  __Pyx_XDECREF(__pyx_t_7);
21317  __Pyx_XDECREF(__pyx_t_8);
21318  __Pyx_XDECREF(__pyx_t_9);
21319  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21320  __pyx_r = 0;
21321  __pyx_L0:;
21322  __Pyx_XGIVEREF(__pyx_r);
21323  __Pyx_RefNannyFinishContext();
21324  return __pyx_r;
21325 }
21326 
21327 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
21328  PyObject *o;
21329  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21330  o = (*t->tp_alloc)(t, 0);
21331  } else {
21332  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21333  }
21334  if (unlikely(!o)) return 0;
21335  if (unlikely(__pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(o, a, k) < 0)) goto bad;
21336  return o;
21337  bad:
21338  Py_DECREF(o); o = 0;
21339  return NULL;
21340 }
21341 
21342 static void __pyx_tp_dealloc_15superluWrappers_cSparseMatrix(PyObject *o) {
21343  #if CYTHON_USE_TP_FINALIZE
21344  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21345  if (PyObject_CallFinalizerFromDealloc(o)) return;
21346  }
21347  #endif
21348  (*Py_TYPE(o)->tp_free)(o);
21349 }
21350 
21351 static PyMethodDef __pyx_methods_15superluWrappers_cSparseMatrix[] = {
21352  {"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, METH_NOARGS, 0},
21353  {"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, METH_O, 0},
21354  {0, 0, 0, 0}
21355 };
21356 
21357 static PyTypeObject __pyx_type_15superluWrappers_cSparseMatrix = {
21358  PyVarObject_HEAD_INIT(0, 0)
21359  "superluWrappers.cSparseMatrix", /*tp_name*/
21360  sizeof(struct __pyx_obj_15superluWrappers_cSparseMatrix), /*tp_basicsize*/
21361  0, /*tp_itemsize*/
21362  __pyx_tp_dealloc_15superluWrappers_cSparseMatrix, /*tp_dealloc*/
21363  0, /*tp_print*/
21364  0, /*tp_getattr*/
21365  0, /*tp_setattr*/
21366  #if PY_MAJOR_VERSION < 3
21367  0, /*tp_compare*/
21368  #endif
21369  #if PY_MAJOR_VERSION >= 3
21370  0, /*tp_as_async*/
21371  #endif
21372  0, /*tp_repr*/
21373  0, /*tp_as_number*/
21374  0, /*tp_as_sequence*/
21375  0, /*tp_as_mapping*/
21376  0, /*tp_hash*/
21377  0, /*tp_call*/
21378  0, /*tp_str*/
21379  0, /*tp_getattro*/
21380  0, /*tp_setattro*/
21381  0, /*tp_as_buffer*/
21382  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21383  0, /*tp_doc*/
21384  0, /*tp_traverse*/
21385  0, /*tp_clear*/
21386  0, /*tp_richcompare*/
21387  0, /*tp_weaklistoffset*/
21388  0, /*tp_iter*/
21389  0, /*tp_iternext*/
21390  __pyx_methods_15superluWrappers_cSparseMatrix, /*tp_methods*/
21391  0, /*tp_members*/
21392  0, /*tp_getset*/
21393  0, /*tp_base*/
21394  0, /*tp_dict*/
21395  0, /*tp_descr_get*/
21396  0, /*tp_descr_set*/
21397  0, /*tp_dictoffset*/
21398  0, /*tp_init*/
21399  0, /*tp_alloc*/
21400  __pyx_tp_new_15superluWrappers_cSparseMatrix, /*tp_new*/
21401  0, /*tp_free*/
21402  0, /*tp_is_gc*/
21403  0, /*tp_bases*/
21404  0, /*tp_mro*/
21405  0, /*tp_cache*/
21406  0, /*tp_subclasses*/
21407  0, /*tp_weaklist*/
21408  0, /*tp_del*/
21409  0, /*tp_version_tag*/
21410  #if PY_VERSION_HEX >= 0x030400a1
21411  0, /*tp_finalize*/
21412  #endif
21413 };
21414 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor __pyx_vtable_15superluWrappers_SparseFactor;
21415 
21416 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21417  struct __pyx_obj_15superluWrappers_SparseFactor *p;
21418  PyObject *o;
21419  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21420  o = (*t->tp_alloc)(t, 0);
21421  } else {
21422  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21423  }
21424  if (unlikely(!o)) return 0;
21425  p = ((struct __pyx_obj_15superluWrappers_SparseFactor *)o);
21426  p->__pyx_vtab = __pyx_vtabptr_15superluWrappers_SparseFactor;
21427  return o;
21428 }
21429 
21430 static void __pyx_tp_dealloc_15superluWrappers_SparseFactor(PyObject *o) {
21431  #if CYTHON_USE_TP_FINALIZE
21432  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21433  if (PyObject_CallFinalizerFromDealloc(o)) return;
21434  }
21435  #endif
21436  (*Py_TYPE(o)->tp_free)(o);
21437 }
21438 
21439 static PyObject *__pyx_getprop_15superluWrappers_12SparseFactor_dim(PyObject *o, CYTHON_UNUSED void *x) {
21440  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(o);
21441 }
21442 
21443 static int __pyx_setprop_15superluWrappers_12SparseFactor_dim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21444  if (v) {
21445  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(o, v);
21446  }
21447  else {
21448  PyErr_SetString(PyExc_NotImplementedError, "__del__");
21449  return -1;
21450  }
21451 }
21452 
21453 static PyMethodDef __pyx_methods_15superluWrappers_SparseFactor[] = {
21454  {"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, METH_NOARGS, 0},
21455  {"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, METH_O, 0},
21456  {0, 0, 0, 0}
21457 };
21458 
21459 static struct PyGetSetDef __pyx_getsets_15superluWrappers_SparseFactor[] = {
21460  {(char *)"dim", __pyx_getprop_15superluWrappers_12SparseFactor_dim, __pyx_setprop_15superluWrappers_12SparseFactor_dim, (char *)0, 0},
21461  {0, 0, 0, 0, 0}
21462 };
21463 
21464 static PyTypeObject __pyx_type_15superluWrappers_SparseFactor = {
21465  PyVarObject_HEAD_INIT(0, 0)
21466  "superluWrappers.SparseFactor", /*tp_name*/
21467  sizeof(struct __pyx_obj_15superluWrappers_SparseFactor), /*tp_basicsize*/
21468  0, /*tp_itemsize*/
21469  __pyx_tp_dealloc_15superluWrappers_SparseFactor, /*tp_dealloc*/
21470  0, /*tp_print*/
21471  0, /*tp_getattr*/
21472  0, /*tp_setattr*/
21473  #if PY_MAJOR_VERSION < 3
21474  0, /*tp_compare*/
21475  #endif
21476  #if PY_MAJOR_VERSION >= 3
21477  0, /*tp_as_async*/
21478  #endif
21479  0, /*tp_repr*/
21480  0, /*tp_as_number*/
21481  0, /*tp_as_sequence*/
21482  0, /*tp_as_mapping*/
21483  0, /*tp_hash*/
21484  0, /*tp_call*/
21485  0, /*tp_str*/
21486  0, /*tp_getattro*/
21487  0, /*tp_setattro*/
21488  0, /*tp_as_buffer*/
21489  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21490  0, /*tp_doc*/
21491  0, /*tp_traverse*/
21492  0, /*tp_clear*/
21493  0, /*tp_richcompare*/
21494  0, /*tp_weaklistoffset*/
21495  0, /*tp_iter*/
21496  0, /*tp_iternext*/
21497  __pyx_methods_15superluWrappers_SparseFactor, /*tp_methods*/
21498  0, /*tp_members*/
21499  __pyx_getsets_15superluWrappers_SparseFactor, /*tp_getset*/
21500  0, /*tp_base*/
21501  0, /*tp_dict*/
21502  0, /*tp_descr_get*/
21503  0, /*tp_descr_set*/
21504  0, /*tp_dictoffset*/
21505  __pyx_pw_15superluWrappers_12SparseFactor_1__init__, /*tp_init*/
21506  0, /*tp_alloc*/
21507  __pyx_tp_new_15superluWrappers_SparseFactor, /*tp_new*/
21508  0, /*tp_free*/
21509  0, /*tp_is_gc*/
21510  0, /*tp_bases*/
21511  0, /*tp_mro*/
21512  0, /*tp_cache*/
21513  0, /*tp_subclasses*/
21514  0, /*tp_weaklist*/
21515  0, /*tp_del*/
21516  0, /*tp_version_tag*/
21517  #if PY_VERSION_HEX >= 0x030400a1
21518  0, /*tp_finalize*/
21519  #endif
21520 };
21521 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21522 
21523 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21524  struct __pyx_array_obj *p;
21525  PyObject *o;
21526  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21527  o = (*t->tp_alloc)(t, 0);
21528  } else {
21529  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21530  }
21531  if (unlikely(!o)) return 0;
21532  p = ((struct __pyx_array_obj *)o);
21533  p->__pyx_vtab = __pyx_vtabptr_array;
21534  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21535  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21536  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21537  return o;
21538  bad:
21539  Py_DECREF(o); o = 0;
21540  return NULL;
21541 }
21542 
21543 static void __pyx_tp_dealloc_array(PyObject *o) {
21544  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21545  #if CYTHON_USE_TP_FINALIZE
21546  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21547  if (PyObject_CallFinalizerFromDealloc(o)) return;
21548  }
21549  #endif
21550  {
21551  PyObject *etype, *eval, *etb;
21552  PyErr_Fetch(&etype, &eval, &etb);
21553  ++Py_REFCNT(o);
21554  __pyx_array___dealloc__(o);
21555  --Py_REFCNT(o);
21556  PyErr_Restore(etype, eval, etb);
21557  }
21558  Py_CLEAR(p->mode);
21559  Py_CLEAR(p->_format);
21560  (*Py_TYPE(o)->tp_free)(o);
21561 }
21562 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21563  PyObject *r;
21564  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21565  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21566  Py_DECREF(x);
21567  return r;
21568 }
21569 
21570 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21571  if (v) {
21572  return __pyx_array___setitem__(o, i, v);
21573  }
21574  else {
21575  PyErr_Format(PyExc_NotImplementedError,
21576  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21577  return -1;
21578  }
21579 }
21580 
21581 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21582  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21583  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21584  PyErr_Clear();
21585  v = __pyx_array___getattr__(o, n);
21586  }
21587  return v;
21588 }
21589 
21590 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21591  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21592 }
21593 
21594 static PyMethodDef __pyx_methods_array[] = {
21595  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21596  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21597  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21598  {0, 0, 0, 0}
21599 };
21600 
21601 static struct PyGetSetDef __pyx_getsets_array[] = {
21602  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21603  {0, 0, 0, 0, 0}
21604 };
21605 
21606 static PySequenceMethods __pyx_tp_as_sequence_array = {
21607  __pyx_array___len__, /*sq_length*/
21608  0, /*sq_concat*/
21609  0, /*sq_repeat*/
21610  __pyx_sq_item_array, /*sq_item*/
21611  0, /*sq_slice*/
21612  0, /*sq_ass_item*/
21613  0, /*sq_ass_slice*/
21614  0, /*sq_contains*/
21615  0, /*sq_inplace_concat*/
21616  0, /*sq_inplace_repeat*/
21617 };
21618 
21619 static PyMappingMethods __pyx_tp_as_mapping_array = {
21620  __pyx_array___len__, /*mp_length*/
21621  __pyx_array___getitem__, /*mp_subscript*/
21622  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21623 };
21624 
21625 static PyBufferProcs __pyx_tp_as_buffer_array = {
21626  #if PY_MAJOR_VERSION < 3
21627  0, /*bf_getreadbuffer*/
21628  #endif
21629  #if PY_MAJOR_VERSION < 3
21630  0, /*bf_getwritebuffer*/
21631  #endif
21632  #if PY_MAJOR_VERSION < 3
21633  0, /*bf_getsegcount*/
21634  #endif
21635  #if PY_MAJOR_VERSION < 3
21636  0, /*bf_getcharbuffer*/
21637  #endif
21638  __pyx_array_getbuffer, /*bf_getbuffer*/
21639  0, /*bf_releasebuffer*/
21640 };
21641 
21642 static PyTypeObject __pyx_type___pyx_array = {
21643  PyVarObject_HEAD_INIT(0, 0)
21644  "superluWrappers.array", /*tp_name*/
21645  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21646  0, /*tp_itemsize*/
21647  __pyx_tp_dealloc_array, /*tp_dealloc*/
21648  0, /*tp_print*/
21649  0, /*tp_getattr*/
21650  0, /*tp_setattr*/
21651  #if PY_MAJOR_VERSION < 3
21652  0, /*tp_compare*/
21653  #endif
21654  #if PY_MAJOR_VERSION >= 3
21655  0, /*tp_as_async*/
21656  #endif
21657  0, /*tp_repr*/
21658  0, /*tp_as_number*/
21659  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21660  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21661  0, /*tp_hash*/
21662  0, /*tp_call*/
21663  0, /*tp_str*/
21664  __pyx_tp_getattro_array, /*tp_getattro*/
21665  0, /*tp_setattro*/
21666  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21667  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21668  0, /*tp_doc*/
21669  0, /*tp_traverse*/
21670  0, /*tp_clear*/
21671  0, /*tp_richcompare*/
21672  0, /*tp_weaklistoffset*/
21673  0, /*tp_iter*/
21674  0, /*tp_iternext*/
21675  __pyx_methods_array, /*tp_methods*/
21676  0, /*tp_members*/
21677  __pyx_getsets_array, /*tp_getset*/
21678  0, /*tp_base*/
21679  0, /*tp_dict*/
21680  0, /*tp_descr_get*/
21681  0, /*tp_descr_set*/
21682  0, /*tp_dictoffset*/
21683  0, /*tp_init*/
21684  0, /*tp_alloc*/
21685  __pyx_tp_new_array, /*tp_new*/
21686  0, /*tp_free*/
21687  0, /*tp_is_gc*/
21688  0, /*tp_bases*/
21689  0, /*tp_mro*/
21690  0, /*tp_cache*/
21691  0, /*tp_subclasses*/
21692  0, /*tp_weaklist*/
21693  0, /*tp_del*/
21694  0, /*tp_version_tag*/
21695  #if PY_VERSION_HEX >= 0x030400a1
21696  0, /*tp_finalize*/
21697  #endif
21698 };
21699 
21700 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21701  struct __pyx_MemviewEnum_obj *p;
21702  PyObject *o;
21703  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21704  o = (*t->tp_alloc)(t, 0);
21705  } else {
21706  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21707  }
21708  if (unlikely(!o)) return 0;
21709  p = ((struct __pyx_MemviewEnum_obj *)o);
21710  p->name = Py_None; Py_INCREF(Py_None);
21711  return o;
21712 }
21713 
21714 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21715  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21716  #if CYTHON_USE_TP_FINALIZE
21717  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21718  if (PyObject_CallFinalizerFromDealloc(o)) return;
21719  }
21720  #endif
21721  PyObject_GC_UnTrack(o);
21722  Py_CLEAR(p->name);
21723  (*Py_TYPE(o)->tp_free)(o);
21724 }
21725 
21726 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21727  int e;
21728  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21729  if (p->name) {
21730  e = (*v)(p->name, a); if (e) return e;
21731  }
21732  return 0;
21733 }
21734 
21735 static int __pyx_tp_clear_Enum(PyObject *o) {
21736  PyObject* tmp;
21737  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21738  tmp = ((PyObject*)p->name);
21739  p->name = Py_None; Py_INCREF(Py_None);
21740  Py_XDECREF(tmp);
21741  return 0;
21742 }
21743 
21744 static PyMethodDef __pyx_methods_Enum[] = {
21745  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21746  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21747  {0, 0, 0, 0}
21748 };
21749 
21750 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21751  PyVarObject_HEAD_INIT(0, 0)
21752  "superluWrappers.Enum", /*tp_name*/
21753  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21754  0, /*tp_itemsize*/
21755  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21756  0, /*tp_print*/
21757  0, /*tp_getattr*/
21758  0, /*tp_setattr*/
21759  #if PY_MAJOR_VERSION < 3
21760  0, /*tp_compare*/
21761  #endif
21762  #if PY_MAJOR_VERSION >= 3
21763  0, /*tp_as_async*/
21764  #endif
21765  __pyx_MemviewEnum___repr__, /*tp_repr*/
21766  0, /*tp_as_number*/
21767  0, /*tp_as_sequence*/
21768  0, /*tp_as_mapping*/
21769  0, /*tp_hash*/
21770  0, /*tp_call*/
21771  0, /*tp_str*/
21772  0, /*tp_getattro*/
21773  0, /*tp_setattro*/
21774  0, /*tp_as_buffer*/
21775  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21776  0, /*tp_doc*/
21777  __pyx_tp_traverse_Enum, /*tp_traverse*/
21778  __pyx_tp_clear_Enum, /*tp_clear*/
21779  0, /*tp_richcompare*/
21780  0, /*tp_weaklistoffset*/
21781  0, /*tp_iter*/
21782  0, /*tp_iternext*/
21783  __pyx_methods_Enum, /*tp_methods*/
21784  0, /*tp_members*/
21785  0, /*tp_getset*/
21786  0, /*tp_base*/
21787  0, /*tp_dict*/
21788  0, /*tp_descr_get*/
21789  0, /*tp_descr_set*/
21790  0, /*tp_dictoffset*/
21791  __pyx_MemviewEnum___init__, /*tp_init*/
21792  0, /*tp_alloc*/
21793  __pyx_tp_new_Enum, /*tp_new*/
21794  0, /*tp_free*/
21795  0, /*tp_is_gc*/
21796  0, /*tp_bases*/
21797  0, /*tp_mro*/
21798  0, /*tp_cache*/
21799  0, /*tp_subclasses*/
21800  0, /*tp_weaklist*/
21801  0, /*tp_del*/
21802  0, /*tp_version_tag*/
21803  #if PY_VERSION_HEX >= 0x030400a1
21804  0, /*tp_finalize*/
21805  #endif
21806 };
21807 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21808 
21809 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21810  struct __pyx_memoryview_obj *p;
21811  PyObject *o;
21812  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21813  o = (*t->tp_alloc)(t, 0);
21814  } else {
21815  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21816  }
21817  if (unlikely(!o)) return 0;
21818  p = ((struct __pyx_memoryview_obj *)o);
21819  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21820  p->obj = Py_None; Py_INCREF(Py_None);
21821  p->_size = Py_None; Py_INCREF(Py_None);
21822  p->_array_interface = Py_None; Py_INCREF(Py_None);
21823  p->view.obj = NULL;
21824  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21825  return o;
21826  bad:
21827  Py_DECREF(o); o = 0;
21828  return NULL;
21829 }
21830 
21831 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21832  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21833  #if CYTHON_USE_TP_FINALIZE
21834  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21835  if (PyObject_CallFinalizerFromDealloc(o)) return;
21836  }
21837  #endif
21838  PyObject_GC_UnTrack(o);
21839  {
21840  PyObject *etype, *eval, *etb;
21841  PyErr_Fetch(&etype, &eval, &etb);
21842  ++Py_REFCNT(o);
21843  __pyx_memoryview___dealloc__(o);
21844  --Py_REFCNT(o);
21845  PyErr_Restore(etype, eval, etb);
21846  }
21847  Py_CLEAR(p->obj);
21848  Py_CLEAR(p->_size);
21849  Py_CLEAR(p->_array_interface);
21850  (*Py_TYPE(o)->tp_free)(o);
21851 }
21852 
21853 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21854  int e;
21855  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21856  if (p->obj) {
21857  e = (*v)(p->obj, a); if (e) return e;
21858  }
21859  if (p->_size) {
21860  e = (*v)(p->_size, a); if (e) return e;
21861  }
21862  if (p->_array_interface) {
21863  e = (*v)(p->_array_interface, a); if (e) return e;
21864  }
21865  if (p->view.obj) {
21866  e = (*v)(p->view.obj, a); if (e) return e;
21867  }
21868  return 0;
21869 }
21870 
21871 static int __pyx_tp_clear_memoryview(PyObject *o) {
21872  PyObject* tmp;
21873  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21874  tmp = ((PyObject*)p->obj);
21875  p->obj = Py_None; Py_INCREF(Py_None);
21876  Py_XDECREF(tmp);
21877  tmp = ((PyObject*)p->_size);
21878  p->_size = Py_None; Py_INCREF(Py_None);
21879  Py_XDECREF(tmp);
21880  tmp = ((PyObject*)p->_array_interface);
21881  p->_array_interface = Py_None; Py_INCREF(Py_None);
21882  Py_XDECREF(tmp);
21883  Py_CLEAR(p->view.obj);
21884  return 0;
21885 }
21886 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21887  PyObject *r;
21888  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21889  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21890  Py_DECREF(x);
21891  return r;
21892 }
21893 
21894 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21895  if (v) {
21896  return __pyx_memoryview___setitem__(o, i, v);
21897  }
21898  else {
21899  PyErr_Format(PyExc_NotImplementedError,
21900  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21901  return -1;
21902  }
21903 }
21904 
21905 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21906  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21907 }
21908 
21909 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21910  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21911 }
21912 
21913 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21914  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21915 }
21916 
21917 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21918  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21919 }
21920 
21921 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21922  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21923 }
21924 
21925 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21926  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21927 }
21928 
21929 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21930  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21931 }
21932 
21933 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21934  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21935 }
21936 
21937 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21938  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21939 }
21940 
21941 static PyMethodDef __pyx_methods_memoryview[] = {
21942  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21943  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21944  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21945  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21946  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21947  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21948  {0, 0, 0, 0}
21949 };
21950 
21951 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21952  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21953  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21954  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21955  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21956  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21957  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21958  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21959  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21960  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21961  {0, 0, 0, 0, 0}
21962 };
21963 
21964 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21965  __pyx_memoryview___len__, /*sq_length*/
21966  0, /*sq_concat*/
21967  0, /*sq_repeat*/
21968  __pyx_sq_item_memoryview, /*sq_item*/
21969  0, /*sq_slice*/
21970  0, /*sq_ass_item*/
21971  0, /*sq_ass_slice*/
21972  0, /*sq_contains*/
21973  0, /*sq_inplace_concat*/
21974  0, /*sq_inplace_repeat*/
21975 };
21976 
21977 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21978  __pyx_memoryview___len__, /*mp_length*/
21979  __pyx_memoryview___getitem__, /*mp_subscript*/
21980  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
21981 };
21982 
21983 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21984  #if PY_MAJOR_VERSION < 3
21985  0, /*bf_getreadbuffer*/
21986  #endif
21987  #if PY_MAJOR_VERSION < 3
21988  0, /*bf_getwritebuffer*/
21989  #endif
21990  #if PY_MAJOR_VERSION < 3
21991  0, /*bf_getsegcount*/
21992  #endif
21993  #if PY_MAJOR_VERSION < 3
21994  0, /*bf_getcharbuffer*/
21995  #endif
21996  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
21997  0, /*bf_releasebuffer*/
21998 };
21999 
22000 static PyTypeObject __pyx_type___pyx_memoryview = {
22001  PyVarObject_HEAD_INIT(0, 0)
22002  "superluWrappers.memoryview", /*tp_name*/
22003  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22004  0, /*tp_itemsize*/
22005  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22006  0, /*tp_print*/
22007  0, /*tp_getattr*/
22008  0, /*tp_setattr*/
22009  #if PY_MAJOR_VERSION < 3
22010  0, /*tp_compare*/
22011  #endif
22012  #if PY_MAJOR_VERSION >= 3
22013  0, /*tp_as_async*/
22014  #endif
22015  __pyx_memoryview___repr__, /*tp_repr*/
22016  0, /*tp_as_number*/
22017  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22018  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22019  0, /*tp_hash*/
22020  0, /*tp_call*/
22021  __pyx_memoryview___str__, /*tp_str*/
22022  0, /*tp_getattro*/
22023  0, /*tp_setattro*/
22024  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22025  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22026  0, /*tp_doc*/
22027  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22028  __pyx_tp_clear_memoryview, /*tp_clear*/
22029  0, /*tp_richcompare*/
22030  0, /*tp_weaklistoffset*/
22031  0, /*tp_iter*/
22032  0, /*tp_iternext*/
22033  __pyx_methods_memoryview, /*tp_methods*/
22034  0, /*tp_members*/
22035  __pyx_getsets_memoryview, /*tp_getset*/
22036  0, /*tp_base*/
22037  0, /*tp_dict*/
22038  0, /*tp_descr_get*/
22039  0, /*tp_descr_set*/
22040  0, /*tp_dictoffset*/
22041  0, /*tp_init*/
22042  0, /*tp_alloc*/
22043  __pyx_tp_new_memoryview, /*tp_new*/
22044  0, /*tp_free*/
22045  0, /*tp_is_gc*/
22046  0, /*tp_bases*/
22047  0, /*tp_mro*/
22048  0, /*tp_cache*/
22049  0, /*tp_subclasses*/
22050  0, /*tp_weaklist*/
22051  0, /*tp_del*/
22052  0, /*tp_version_tag*/
22053  #if PY_VERSION_HEX >= 0x030400a1
22054  0, /*tp_finalize*/
22055  #endif
22056 };
22057 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22058 
22059 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22060  struct __pyx_memoryviewslice_obj *p;
22061  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22062  if (unlikely(!o)) return 0;
22063  p = ((struct __pyx_memoryviewslice_obj *)o);
22064  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22065  p->from_object = Py_None; Py_INCREF(Py_None);
22066  p->from_slice.memview = NULL;
22067  return o;
22068 }
22069 
22070 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22071  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22072  #if CYTHON_USE_TP_FINALIZE
22073  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22074  if (PyObject_CallFinalizerFromDealloc(o)) return;
22075  }
22076  #endif
22077  PyObject_GC_UnTrack(o);
22078  {
22079  PyObject *etype, *eval, *etb;
22080  PyErr_Fetch(&etype, &eval, &etb);
22081  ++Py_REFCNT(o);
22082  __pyx_memoryviewslice___dealloc__(o);
22083  --Py_REFCNT(o);
22084  PyErr_Restore(etype, eval, etb);
22085  }
22086  Py_CLEAR(p->from_object);
22087  PyObject_GC_Track(o);
22088  __pyx_tp_dealloc_memoryview(o);
22089 }
22090 
22091 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22092  int e;
22093  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22094  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22095  if (p->from_object) {
22096  e = (*v)(p->from_object, a); if (e) return e;
22097  }
22098  return 0;
22099 }
22100 
22101 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22102  PyObject* tmp;
22103  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22104  __pyx_tp_clear_memoryview(o);
22105  tmp = ((PyObject*)p->from_object);
22106  p->from_object = Py_None; Py_INCREF(Py_None);
22107  Py_XDECREF(tmp);
22108  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22109  return 0;
22110 }
22111 
22112 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22113  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22114 }
22115 
22116 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22117  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22118  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22119  {0, 0, 0, 0}
22120 };
22121 
22122 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22123  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22124  {0, 0, 0, 0, 0}
22125 };
22126 
22127 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22128  PyVarObject_HEAD_INIT(0, 0)
22129  "superluWrappers._memoryviewslice", /*tp_name*/
22130  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22131  0, /*tp_itemsize*/
22132  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22133  0, /*tp_print*/
22134  0, /*tp_getattr*/
22135  0, /*tp_setattr*/
22136  #if PY_MAJOR_VERSION < 3
22137  0, /*tp_compare*/
22138  #endif
22139  #if PY_MAJOR_VERSION >= 3
22140  0, /*tp_as_async*/
22141  #endif
22142  #if CYTHON_COMPILING_IN_PYPY
22143  __pyx_memoryview___repr__, /*tp_repr*/
22144  #else
22145  0, /*tp_repr*/
22146  #endif
22147  0, /*tp_as_number*/
22148  0, /*tp_as_sequence*/
22149  0, /*tp_as_mapping*/
22150  0, /*tp_hash*/
22151  0, /*tp_call*/
22152  #if CYTHON_COMPILING_IN_PYPY
22153  __pyx_memoryview___str__, /*tp_str*/
22154  #else
22155  0, /*tp_str*/
22156  #endif
22157  0, /*tp_getattro*/
22158  0, /*tp_setattro*/
22159  0, /*tp_as_buffer*/
22160  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22161  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22162  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22163  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22164  0, /*tp_richcompare*/
22165  0, /*tp_weaklistoffset*/
22166  0, /*tp_iter*/
22167  0, /*tp_iternext*/
22168  __pyx_methods__memoryviewslice, /*tp_methods*/
22169  0, /*tp_members*/
22170  __pyx_getsets__memoryviewslice, /*tp_getset*/
22171  0, /*tp_base*/
22172  0, /*tp_dict*/
22173  0, /*tp_descr_get*/
22174  0, /*tp_descr_set*/
22175  0, /*tp_dictoffset*/
22176  0, /*tp_init*/
22177  0, /*tp_alloc*/
22178  __pyx_tp_new__memoryviewslice, /*tp_new*/
22179  0, /*tp_free*/
22180  0, /*tp_is_gc*/
22181  0, /*tp_bases*/
22182  0, /*tp_mro*/
22183  0, /*tp_cache*/
22184  0, /*tp_subclasses*/
22185  0, /*tp_weaklist*/
22186  0, /*tp_del*/
22187  0, /*tp_version_tag*/
22188  #if PY_VERSION_HEX >= 0x030400a1
22189  0, /*tp_finalize*/
22190  #endif
22191 };
22192 
22193 static PyMethodDef __pyx_methods[] = {
22194  {0, 0, 0, 0}
22195 };
22196 
22197 #if PY_MAJOR_VERSION >= 3
22198 #if CYTHON_PEP489_MULTI_PHASE_INIT
22199 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22200 static int __pyx_pymod_exec_superluWrappers(PyObject* module); /*proto*/
22201 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22202  {Py_mod_create, (void*)__pyx_pymod_create},
22203  {Py_mod_exec, (void*)__pyx_pymod_exec_superluWrappers},
22204  {0, NULL}
22205 };
22206 #endif
22207 
22208 static struct PyModuleDef __pyx_moduledef = {
22209  PyModuleDef_HEAD_INIT,
22210  "superluWrappers",
22211  0, /* m_doc */
22212  #if CYTHON_PEP489_MULTI_PHASE_INIT
22213  0, /* m_size */
22214  #else
22215  -1, /* m_size */
22216  #endif
22217  __pyx_methods /* m_methods */,
22218  #if CYTHON_PEP489_MULTI_PHASE_INIT
22219  __pyx_moduledef_slots, /* m_slots */
22220  #else
22221  NULL, /* m_reload */
22222  #endif
22223  NULL, /* m_traverse */
22224  NULL, /* m_clear */
22225  NULL /* m_free */
22226 };
22227 #endif
22228 
22229 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22230  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22231  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22232  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22233  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22234  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22235  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22236  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22237  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22238  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22239  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22240  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22241  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22242  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22243  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22244  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22245  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22246  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22247  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22248  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22249  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22250  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22251  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22252  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22253  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22254  {&__pyx_n_s_SparseMatrix, __pyx_k_SparseMatrix, sizeof(__pyx_k_SparseMatrix), 0, 0, 1, 1},
22255  {&__pyx_n_s_SparseMatrix___init, __pyx_k_SparseMatrix___init, sizeof(__pyx_k_SparseMatrix___init), 0, 0, 1, 1},
22256  {&__pyx_n_s_SparseMatrix_fwrite, __pyx_k_SparseMatrix_fwrite, sizeof(__pyx_k_SparseMatrix_fwrite), 0, 0, 1, 1},
22257  {&__pyx_n_s_SparseMatrix_getCSRrepresentatio, __pyx_k_SparseMatrix_getCSRrepresentatio, sizeof(__pyx_k_SparseMatrix_getCSRrepresentatio), 0, 0, 1, 1},
22258  {&__pyx_n_s_SparseMatrix_getSubMatCSRreprese, __pyx_k_SparseMatrix_getSubMatCSRreprese, sizeof(__pyx_k_SparseMatrix_getSubMatCSRreprese), 0, 0, 1, 1},
22259  {&__pyx_n_s_SparseMatrix_matvec, __pyx_k_SparseMatrix_matvec, sizeof(__pyx_k_SparseMatrix_matvec), 0, 0, 1, 1},
22260  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22261  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22262  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22263  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22264  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22265  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22266  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22267  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22268  {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix, sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
22269  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22270  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22271  {&__pyx_n_s_colind, __pyx_k_colind, sizeof(__pyx_k_colind), 0, 0, 1, 1},
22272  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22273  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22274  {&__pyx_kp_s_d_d_13_8e, __pyx_k_d_d_13_8e, sizeof(__pyx_k_d_d_13_8e), 0, 0, 1, 0},
22275  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22276  {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1},
22277  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
22278  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22279  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22280  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
22281  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22282  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22283  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
22284  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
22285  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22286  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22287  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22288  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22289  {&__pyx_n_s_fwrite, __pyx_k_fwrite, sizeof(__pyx_k_fwrite), 0, 0, 1, 1},
22290  {&__pyx_n_s_getCSRrepresentation, __pyx_k_getCSRrepresentation, sizeof(__pyx_k_getCSRrepresentation), 0, 0, 1, 1},
22291  {&__pyx_n_s_getSubMatCSRrepresentation, __pyx_k_getSubMatCSRrepresentation, sizeof(__pyx_k_getSubMatCSRrepresentation), 0, 0, 1, 1},
22292  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22293  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22294  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
22295  {&__pyx_kp_s_i_i_i, __pyx_k_i_i_i, sizeof(__pyx_k_i_i_i), 0, 0, 1, 0},
22296  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22297  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22298  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
22299  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22300  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22301  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
22302  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22303  {&__pyx_n_s_matvec, __pyx_k_matvec, sizeof(__pyx_k_matvec), 0, 0, 1, 1},
22304  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22305  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
22306  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22307  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
22308  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22309  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22310  {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
22311  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
22312  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
22313  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22314  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22315  {&__pyx_n_s_nnz, __pyx_k_nnz, sizeof(__pyx_k_nnz), 0, 0, 1, 1},
22316  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22317  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22318  {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
22319  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22320  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22321  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22322  {&__pyx_n_s_nzval, __pyx_k_nzval, sizeof(__pyx_k_nzval), 0, 0, 1, 1},
22323  {&__pyx_n_s_nzvals, __pyx_k_nzvals, sizeof(__pyx_k_nzvals), 0, 0, 1, 1},
22324  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22325  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
22326  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
22327  {&__pyx_n_s_output_file, __pyx_k_output_file, sizeof(__pyx_k_output_file), 0, 0, 1, 1},
22328  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22329  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22330  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
22331  {&__pyx_kp_s_proteus_superluWrappers_pyx, __pyx_k_proteus_superluWrappers_pyx, sizeof(__pyx_k_proteus_superluWrappers_pyx), 0, 0, 1, 0},
22332  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22333  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22334  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22335  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22336  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22337  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22338  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22339  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22340  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
22341  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22342  {&__pyx_n_s_range_end, __pyx_k_range_end, sizeof(__pyx_k_range_end), 0, 0, 1, 1},
22343  {&__pyx_n_s_range_start, __pyx_k_range_start, sizeof(__pyx_k_range_start), 0, 0, 1, 1},
22344  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22345  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22346  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22347  {&__pyx_n_s_rowptr, __pyx_k_rowptr, sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
22348  {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1},
22349  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22350  {&__pyx_kp_s_self_A_self_AC_self_L_self_U_sel, __pyx_k_self_A_self_AC_self_L_self_U_sel, sizeof(__pyx_k_self_A_self_AC_self_L_self_U_sel), 0, 0, 1, 0},
22351  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22352  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22353  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22354  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22355  {&__pyx_n_s_sparseFactor, __pyx_k_sparseFactor, sizeof(__pyx_k_sparseFactor), 0, 0, 1, 1},
22356  {&__pyx_n_s_sparseFactorPrepare, __pyx_k_sparseFactorPrepare, sizeof(__pyx_k_sparseFactorPrepare), 0, 0, 1, 1},
22357  {&__pyx_n_s_sparseFactorSolve, __pyx_k_sparseFactorSolve, sizeof(__pyx_k_sparseFactorSolve), 0, 0, 1, 1},
22358  {&__pyx_n_s_sparse_matrix, __pyx_k_sparse_matrix, sizeof(__pyx_k_sparse_matrix), 0, 0, 1, 1},
22359  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22360  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22361  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22362  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22363  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22364  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22365  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22366  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22367  {&__pyx_n_s_superluWrappers, __pyx_k_superluWrappers, sizeof(__pyx_k_superluWrappers), 0, 0, 1, 1},
22368  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22369  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22370  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22371  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22372  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22373  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22374  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
22375  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
22376  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
22377  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
22378  {0, 0, 0, 0, 0, 0, 0}
22379 };
22380 static int __Pyx_InitCachedBuiltins(void) {
22381  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 13, __pyx_L1_error)
22382  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 56, __pyx_L1_error)
22383  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 58, __pyx_L1_error)
22384  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22385  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 229, __pyx_L1_error)
22386  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 810, __pyx_L1_error)
22387  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1000, __pyx_L1_error)
22388  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 147, __pyx_L1_error)
22389  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 150, __pyx_L1_error)
22390  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 399, __pyx_L1_error)
22391  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 608, __pyx_L1_error)
22392  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 827, __pyx_L1_error)
22393  return 0;
22394  __pyx_L1_error:;
22395  return -1;
22396 }
22397 
22398 static int __Pyx_InitCachedConstants(void) {
22399  __Pyx_RefNannyDeclarations
22400  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22401 
22402  /* "superluWrappers.pyx":56
22403  * ?!Possibly something to do with parallel?!
22404  * """
22405  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
22406  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
22407  * for i in range(self.nr):
22408  */
22409  __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 56, __pyx_L1_error)
22410  __Pyx_GOTREF(__pyx_tuple_);
22411  __Pyx_GIVEREF(__pyx_tuple_);
22412 
22413  /* "(tree fragment)":2
22414  * def __reduce_cython__(self):
22415  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22416  * def __setstate_cython__(self, __pyx_state):
22417  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22418  */
22419  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
22420  __Pyx_GOTREF(__pyx_tuple__2);
22421  __Pyx_GIVEREF(__pyx_tuple__2);
22422 
22423  /* "(tree fragment)":4
22424  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22425  * def __setstate_cython__(self, __pyx_state):
22426  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22427  */
22428  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)
22429  __Pyx_GOTREF(__pyx_tuple__3);
22430  __Pyx_GIVEREF(__pyx_tuple__3);
22431 
22432  /* "(tree fragment)":2
22433  * def __reduce_cython__(self):
22434  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22435  * def __setstate_cython__(self, __pyx_state):
22436  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
22437  */
22438  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
22439  __Pyx_GOTREF(__pyx_tuple__4);
22440  __Pyx_GIVEREF(__pyx_tuple__4);
22441 
22442  /* "(tree fragment)":4
22443  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
22444  * def __setstate_cython__(self, __pyx_state):
22445  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22446  */
22447  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
22448  __Pyx_GOTREF(__pyx_tuple__5);
22449  __Pyx_GIVEREF(__pyx_tuple__5);
22450 
22451  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
22452  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
22453  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
22454  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
22455  *
22456  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22457  */
22458  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 229, __pyx_L1_error)
22459  __Pyx_GOTREF(__pyx_tuple__6);
22460  __Pyx_GIVEREF(__pyx_tuple__6);
22461 
22462  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
22463  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22464  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
22465  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
22466  *
22467  * info.buf = PyArray_DATA(self)
22468  */
22469  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 233, __pyx_L1_error)
22470  __Pyx_GOTREF(__pyx_tuple__7);
22471  __Pyx_GIVEREF(__pyx_tuple__7);
22472 
22473  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
22474  * if ((descr.byteorder == c'>' and little_endian) or
22475  * (descr.byteorder == c'<' and not little_endian)):
22476  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
22477  * if t == NPY_BYTE: f = "b"
22478  * elif t == NPY_UBYTE: f = "B"
22479  */
22480  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 263, __pyx_L1_error)
22481  __Pyx_GOTREF(__pyx_tuple__8);
22482  __Pyx_GIVEREF(__pyx_tuple__8);
22483 
22484  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":810
22485  *
22486  * if (end - f) - <int>(new_offset - offset[0]) < 15:
22487  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
22488  *
22489  * if ((child.byteorder == c'>' and little_endian) or
22490  */
22491  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 810, __pyx_L1_error)
22492  __Pyx_GOTREF(__pyx_tuple__9);
22493  __Pyx_GIVEREF(__pyx_tuple__9);
22494 
22495  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
22496  * if ((child.byteorder == c'>' and little_endian) or
22497  * (child.byteorder == c'<' and not little_endian)):
22498  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
22499  * # One could encode it in the format string and have Cython
22500  * # complain instead, BUT: < and > in format strings also imply
22501  */
22502  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 814, __pyx_L1_error)
22503  __Pyx_GOTREF(__pyx_tuple__10);
22504  __Pyx_GIVEREF(__pyx_tuple__10);
22505 
22506  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
22507  * t = child.type_num
22508  * if end - f < 5:
22509  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
22510  *
22511  * # Until ticket #99 is fixed, use integers to avoid warnings
22512  */
22513  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 834, __pyx_L1_error)
22514  __Pyx_GOTREF(__pyx_tuple__11);
22515  __Pyx_GIVEREF(__pyx_tuple__11);
22516 
22517  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
22518  * _import_array()
22519  * except Exception:
22520  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22521  *
22522  * cdef inline int import_umath() except -1:
22523  */
22524  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 1000, __pyx_L1_error)
22525  __Pyx_GOTREF(__pyx_tuple__12);
22526  __Pyx_GIVEREF(__pyx_tuple__12);
22527 
22528  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1006
22529  * _import_umath()
22530  * except Exception:
22531  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22532  *
22533  * cdef inline int import_ufunc() except -1:
22534  */
22535  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 1006, __pyx_L1_error)
22536  __Pyx_GOTREF(__pyx_tuple__13);
22537  __Pyx_GIVEREF(__pyx_tuple__13);
22538 
22539  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1012
22540  * _import_umath()
22541  * except Exception:
22542  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22543  */
22544  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 1012, __pyx_L1_error)
22545  __Pyx_GOTREF(__pyx_tuple__14);
22546  __Pyx_GIVEREF(__pyx_tuple__14);
22547 
22548  /* "View.MemoryView":132
22549  *
22550  * if not self.ndim:
22551  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22552  *
22553  * if itemsize <= 0:
22554  */
22555  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 132, __pyx_L1_error)
22556  __Pyx_GOTREF(__pyx_tuple__15);
22557  __Pyx_GIVEREF(__pyx_tuple__15);
22558 
22559  /* "View.MemoryView":135
22560  *
22561  * if itemsize <= 0:
22562  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22563  *
22564  * if not isinstance(format, bytes):
22565  */
22566  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 135, __pyx_L1_error)
22567  __Pyx_GOTREF(__pyx_tuple__16);
22568  __Pyx_GIVEREF(__pyx_tuple__16);
22569 
22570  /* "View.MemoryView":138
22571  *
22572  * if not isinstance(format, bytes):
22573  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
22574  * self._format = format # keep a reference to the byte string
22575  * self.format = self._format
22576  */
22577  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 138, __pyx_L1_error)
22578  __Pyx_GOTREF(__pyx_tuple__17);
22579  __Pyx_GIVEREF(__pyx_tuple__17);
22580 
22581  /* "View.MemoryView":147
22582  *
22583  * if not self._shape:
22584  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22585  *
22586  *
22587  */
22588  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 147, __pyx_L1_error)
22589  __Pyx_GOTREF(__pyx_tuple__18);
22590  __Pyx_GIVEREF(__pyx_tuple__18);
22591 
22592  /* "View.MemoryView":175
22593  * self.data = <char *>malloc(self.len)
22594  * if not self.data:
22595  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22596  *
22597  * if self.dtype_is_object:
22598  */
22599  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 175, __pyx_L1_error)
22600  __Pyx_GOTREF(__pyx_tuple__19);
22601  __Pyx_GIVEREF(__pyx_tuple__19);
22602 
22603  /* "View.MemoryView":191
22604  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22605  * if not (flags & bufmode):
22606  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22607  * info.buf = self.data
22608  * info.len = self.len
22609  */
22610  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 191, __pyx_L1_error)
22611  __Pyx_GOTREF(__pyx_tuple__20);
22612  __Pyx_GIVEREF(__pyx_tuple__20);
22613 
22614  /* "(tree fragment)":2
22615  * def __reduce_cython__(self):
22616  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22617  * def __setstate_cython__(self, __pyx_state):
22618  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22619  */
22620  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 2, __pyx_L1_error)
22621  __Pyx_GOTREF(__pyx_tuple__21);
22622  __Pyx_GIVEREF(__pyx_tuple__21);
22623 
22624  /* "(tree fragment)":4
22625  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22626  * def __setstate_cython__(self, __pyx_state):
22627  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22628  */
22629  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 4, __pyx_L1_error)
22630  __Pyx_GOTREF(__pyx_tuple__22);
22631  __Pyx_GIVEREF(__pyx_tuple__22);
22632 
22633  /* "View.MemoryView":413
22634  * def __setitem__(memoryview self, object index, object value):
22635  * if self.view.readonly:
22636  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22637  *
22638  * have_slices, index = _unellipsify(index, self.view.ndim)
22639  */
22640  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 413, __pyx_L1_error)
22641  __Pyx_GOTREF(__pyx_tuple__23);
22642  __Pyx_GIVEREF(__pyx_tuple__23);
22643 
22644  /* "View.MemoryView":490
22645  * result = struct.unpack(self.view.format, bytesitem)
22646  * except struct.error:
22647  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22648  * else:
22649  * if len(self.view.format) == 1:
22650  */
22651  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 490, __pyx_L1_error)
22652  __Pyx_GOTREF(__pyx_tuple__24);
22653  __Pyx_GIVEREF(__pyx_tuple__24);
22654 
22655  /* "View.MemoryView":515
22656  * def __getbuffer__(self, Py_buffer *info, int flags):
22657  * if flags & PyBUF_WRITABLE and self.view.readonly:
22658  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22659  *
22660  * if flags & PyBUF_STRIDES:
22661  */
22662  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 515, __pyx_L1_error)
22663  __Pyx_GOTREF(__pyx_tuple__25);
22664  __Pyx_GIVEREF(__pyx_tuple__25);
22665 
22666  /* "View.MemoryView":565
22667  * if self.view.strides == NULL:
22668  *
22669  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22670  *
22671  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22672  */
22673  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 565, __pyx_L1_error)
22674  __Pyx_GOTREF(__pyx_tuple__26);
22675  __Pyx_GIVEREF(__pyx_tuple__26);
22676 
22677  /* "View.MemoryView":572
22678  * def suboffsets(self):
22679  * if self.view.suboffsets == NULL:
22680  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22681  *
22682  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22683  */
22684  __pyx_tuple__27 = PyTuple_New(1); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 572, __pyx_L1_error)
22685  __Pyx_GOTREF(__pyx_tuple__27);
22686  __Pyx_INCREF(__pyx_int_neg_1);
22687  __Pyx_GIVEREF(__pyx_int_neg_1);
22688  PyTuple_SET_ITEM(__pyx_tuple__27, 0, __pyx_int_neg_1);
22689  __Pyx_GIVEREF(__pyx_tuple__27);
22690 
22691  /* "(tree fragment)":2
22692  * def __reduce_cython__(self):
22693  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22694  * def __setstate_cython__(self, __pyx_state):
22695  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22696  */
22697  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
22698  __Pyx_GOTREF(__pyx_tuple__28);
22699  __Pyx_GIVEREF(__pyx_tuple__28);
22700 
22701  /* "(tree fragment)":4
22702  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22703  * def __setstate_cython__(self, __pyx_state):
22704  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22705  */
22706  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
22707  __Pyx_GOTREF(__pyx_tuple__29);
22708  __Pyx_GIVEREF(__pyx_tuple__29);
22709 
22710  /* "View.MemoryView":677
22711  * if item is Ellipsis:
22712  * if not seen_ellipsis:
22713  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22714  * seen_ellipsis = True
22715  * else:
22716  */
22717  __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(1, 677, __pyx_L1_error)
22718  __Pyx_GOTREF(__pyx_slice__30);
22719  __Pyx_GIVEREF(__pyx_slice__30);
22720 
22721  /* "View.MemoryView":680
22722  * seen_ellipsis = True
22723  * else:
22724  * result.append(slice(None)) # <<<<<<<<<<<<<<
22725  * have_slices = True
22726  * else:
22727  */
22728  __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(1, 680, __pyx_L1_error)
22729  __Pyx_GOTREF(__pyx_slice__31);
22730  __Pyx_GIVEREF(__pyx_slice__31);
22731 
22732  /* "View.MemoryView":691
22733  * nslices = ndim - len(result)
22734  * if nslices:
22735  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
22736  *
22737  * return have_slices or nslices, tuple(result)
22738  */
22739  __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 691, __pyx_L1_error)
22740  __Pyx_GOTREF(__pyx_slice__32);
22741  __Pyx_GIVEREF(__pyx_slice__32);
22742 
22743  /* "View.MemoryView":698
22744  * for suboffset in suboffsets[:ndim]:
22745  * if suboffset >= 0:
22746  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22747  *
22748  *
22749  */
22750  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 698, __pyx_L1_error)
22751  __Pyx_GOTREF(__pyx_tuple__33);
22752  __Pyx_GIVEREF(__pyx_tuple__33);
22753 
22754  /* "(tree fragment)":2
22755  * def __reduce_cython__(self):
22756  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22757  * def __setstate_cython__(self, __pyx_state):
22758  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22759  */
22760  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
22761  __Pyx_GOTREF(__pyx_tuple__34);
22762  __Pyx_GIVEREF(__pyx_tuple__34);
22763 
22764  /* "(tree fragment)":4
22765  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22766  * def __setstate_cython__(self, __pyx_state):
22767  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22768  */
22769  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
22770  __Pyx_GOTREF(__pyx_tuple__35);
22771  __Pyx_GIVEREF(__pyx_tuple__35);
22772 
22773  /* "superluWrappers.pyx":13
22774  * from libc.stdlib cimport malloc
22775  *
22776  * class SparseMatrix(object): # <<<<<<<<<<<<<<
22777  *
22778  * def __init__(self,
22779  */
22780  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 13, __pyx_L1_error)
22781  __Pyx_GOTREF(__pyx_tuple__36);
22782  __Pyx_GIVEREF(__pyx_tuple__36);
22783 
22784  /* "superluWrappers.pyx":15
22785  * class SparseMatrix(object):
22786  *
22787  * def __init__(self, # <<<<<<<<<<<<<<
22788  * nr,
22789  * nc,
22790  */
22791  __pyx_tuple__37 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_nr, __pyx_n_s_nc, __pyx_n_s_nnz, __pyx_n_s_nzvals, __pyx_n_s_colind, __pyx_n_s_rowptr); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 15, __pyx_L1_error)
22792  __Pyx_GOTREF(__pyx_tuple__37);
22793  __Pyx_GIVEREF(__pyx_tuple__37);
22794  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_init, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 15, __pyx_L1_error)
22795 
22796  /* "superluWrappers.pyx":35
22797  * self.rowptr)
22798  *
22799  * def matvec(self, x, y): # <<<<<<<<<<<<<<
22800  * """
22801  * Compute the sparse matrix-vector product y = Ax
22802  */
22803  __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 35, __pyx_L1_error)
22804  __Pyx_GOTREF(__pyx_tuple__39);
22805  __Pyx_GIVEREF(__pyx_tuple__39);
22806  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_matvec, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 35, __pyx_L1_error)
22807 
22808  /* "superluWrappers.pyx":46
22809  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
22810  *
22811  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
22812  * """ Write the sparse matrix to a file
22813  *
22814  */
22815  __pyx_tuple__41 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_base, __pyx_n_s_output_file, __pyx_n_s_i, __pyx_n_s_k); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 46, __pyx_L1_error)
22816  __Pyx_GOTREF(__pyx_tuple__41);
22817  __Pyx_GIVEREF(__pyx_tuple__41);
22818  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_fwrite, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 46, __pyx_L1_error)
22819 
22820  /* "superluWrappers.pyx":62
22821  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22822  *
22823  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
22824  * """ Get the CSR representation of the sparse matrix.
22825  *
22826  */
22827  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 62, __pyx_L1_error)
22828  __Pyx_GOTREF(__pyx_tuple__43);
22829  __Pyx_GIVEREF(__pyx_tuple__43);
22830  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getCSRrepresentation, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 62, __pyx_L1_error)
22831 
22832  /* "superluWrappers.pyx":72
22833  * return (self.rowptr, self.colind, self.nzvals)
22834  *
22835  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
22836  * range_start,
22837  * range_end):
22838  */
22839  __pyx_tuple__45 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_range_start, __pyx_n_s_range_end, __pyx_n_s_rows, __pyx_n_s_nnz, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nzvals); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 72, __pyx_L1_error)
22840  __Pyx_GOTREF(__pyx_tuple__45);
22841  __Pyx_GIVEREF(__pyx_tuple__45);
22842  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getSubMatCSRrepresentation, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 72, __pyx_L1_error)
22843 
22844  /* "superluWrappers.pyx":219
22845  * self.X.Store = &self.storeX
22846  *
22847  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
22848  * sparseFactor):
22849  * """ Python wrapper for superlu Sparse Factor Prepare function.
22850  */
22851  __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_sparse_matrix, __pyx_n_s_sparseFactor); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 219, __pyx_L1_error)
22852  __Pyx_GOTREF(__pyx_tuple__47);
22853  __Pyx_GIVEREF(__pyx_tuple__47);
22854  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorPrepare, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 219, __pyx_L1_error)
22855 
22856  /* "superluWrappers.pyx":286
22857  * &info)
22858  *
22859  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
22860  * x):
22861  * """ Sparse factor solve wrappers
22862  */
22863  __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_sparseFactor, __pyx_n_s_x); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 286, __pyx_L1_error)
22864  __Pyx_GOTREF(__pyx_tuple__49);
22865  __Pyx_GIVEREF(__pyx_tuple__49);
22866  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorSolve, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 286, __pyx_L1_error)
22867 
22868  /* "View.MemoryView":285
22869  * return self.name
22870  *
22871  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22872  * cdef strided = Enum("<strided and direct>") # default
22873  * cdef indirect = Enum("<strided and indirect>")
22874  */
22875  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 285, __pyx_L1_error)
22876  __Pyx_GOTREF(__pyx_tuple__51);
22877  __Pyx_GIVEREF(__pyx_tuple__51);
22878 
22879  /* "View.MemoryView":286
22880  *
22881  * cdef generic = Enum("<strided and direct or indirect>")
22882  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22883  * cdef indirect = Enum("<strided and indirect>")
22884  *
22885  */
22886  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 286, __pyx_L1_error)
22887  __Pyx_GOTREF(__pyx_tuple__52);
22888  __Pyx_GIVEREF(__pyx_tuple__52);
22889 
22890  /* "View.MemoryView":287
22891  * cdef generic = Enum("<strided and direct or indirect>")
22892  * cdef strided = Enum("<strided and direct>") # default
22893  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22894  *
22895  *
22896  */
22897  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 287, __pyx_L1_error)
22898  __Pyx_GOTREF(__pyx_tuple__53);
22899  __Pyx_GIVEREF(__pyx_tuple__53);
22900 
22901  /* "View.MemoryView":290
22902  *
22903  *
22904  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22905  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22906  *
22907  */
22908  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 290, __pyx_L1_error)
22909  __Pyx_GOTREF(__pyx_tuple__54);
22910  __Pyx_GIVEREF(__pyx_tuple__54);
22911 
22912  /* "View.MemoryView":291
22913  *
22914  * cdef contiguous = Enum("<contiguous and direct>")
22915  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22916  *
22917  *
22918  */
22919  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 291, __pyx_L1_error)
22920  __Pyx_GOTREF(__pyx_tuple__55);
22921  __Pyx_GIVEREF(__pyx_tuple__55);
22922 
22923  /* "(tree fragment)":1
22924  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22925  * if __pyx_checksum != 0xb068931:
22926  * from pickle import PickleError as __pyx_PickleError
22927  */
22928  __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 1, __pyx_L1_error)
22929  __Pyx_GOTREF(__pyx_tuple__56);
22930  __Pyx_GIVEREF(__pyx_tuple__56);
22931  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(1, 1, __pyx_L1_error)
22932  __Pyx_RefNannyFinishContext();
22933  return 0;
22934  __pyx_L1_error:;
22935  __Pyx_RefNannyFinishContext();
22936  return -1;
22937 }
22938 
22939 static int __Pyx_InitGlobals(void) {
22940  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22941  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22942  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22943  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22944  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22945  return 0;
22946  __pyx_L1_error:;
22947  return -1;
22948 }
22949 
22950 static int __Pyx_modinit_global_init_code(void); /*proto*/
22951 static int __Pyx_modinit_variable_export_code(void); /*proto*/
22952 static int __Pyx_modinit_function_export_code(void); /*proto*/
22953 static int __Pyx_modinit_type_init_code(void); /*proto*/
22954 static int __Pyx_modinit_type_import_code(void); /*proto*/
22955 static int __Pyx_modinit_variable_import_code(void); /*proto*/
22956 static int __Pyx_modinit_function_import_code(void); /*proto*/
22957 
22958 static int __Pyx_modinit_global_init_code(void) {
22959  __Pyx_RefNannyDeclarations
22960  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22961  /*--- Global init code ---*/
22962  generic = Py_None; Py_INCREF(Py_None);
22963  strided = Py_None; Py_INCREF(Py_None);
22964  indirect = Py_None; Py_INCREF(Py_None);
22965  contiguous = Py_None; Py_INCREF(Py_None);
22966  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22967  __Pyx_RefNannyFinishContext();
22968  return 0;
22969 }
22970 
22971 static int __Pyx_modinit_variable_export_code(void) {
22972  __Pyx_RefNannyDeclarations
22973  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22974  /*--- Variable export code ---*/
22975  __Pyx_RefNannyFinishContext();
22976  return 0;
22977 }
22978 
22979 static int __Pyx_modinit_function_export_code(void) {
22980  __Pyx_RefNannyDeclarations
22981  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22982  /*--- Function export code ---*/
22983  __Pyx_RefNannyFinishContext();
22984  return 0;
22985 }
22986 
22987 static int __Pyx_modinit_type_init_code(void) {
22988  __Pyx_RefNannyDeclarations
22989  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22990  /*--- Type init code ---*/
22991  if (PyType_Ready(&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22992  __pyx_type_15superluWrappers_cSparseMatrix.tp_print = 0;
22993  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_cSparseMatrix.tp_dictoffset && __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22994  __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22995  }
22996  if (PyObject_SetAttrString(__pyx_m, "cSparseMatrix", (PyObject *)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22997  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22998  __pyx_ptype_15superluWrappers_cSparseMatrix = &__pyx_type_15superluWrappers_cSparseMatrix;
22999  __pyx_vtabptr_15superluWrappers_SparseFactor = &__pyx_vtable_15superluWrappers_SparseFactor;
23000  __pyx_vtable_15superluWrappers_SparseFactor._set_mat_types = (PyObject *(*)(struct __pyx_obj_15superluWrappers_SparseFactor *))__pyx_f_15superluWrappers_12SparseFactor__set_mat_types;
23001  if (PyType_Ready(&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
23002  __pyx_type_15superluWrappers_SparseFactor.tp_print = 0;
23003  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_SparseFactor.tp_dictoffset && __pyx_type_15superluWrappers_SparseFactor.tp_getattro == PyObject_GenericGetAttr)) {
23004  __pyx_type_15superluWrappers_SparseFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23005  }
23006  #if CYTHON_COMPILING_IN_CPYTHON
23007  {
23008  PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_15superluWrappers_SparseFactor, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 145, __pyx_L1_error)
23009  if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
23010  __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
23011  __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__.doc = __pyx_doc_15superluWrappers_12SparseFactor___init__;
23012  ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
23013  }
23014  }
23015  #endif
23016  if (__Pyx_SetVtable(__pyx_type_15superluWrappers_SparseFactor.tp_dict, __pyx_vtabptr_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
23017  if (PyObject_SetAttrString(__pyx_m, "SparseFactor", (PyObject *)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
23018  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
23019  __pyx_ptype_15superluWrappers_SparseFactor = &__pyx_type_15superluWrappers_SparseFactor;
23020  __pyx_vtabptr_array = &__pyx_vtable_array;
23021  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23022  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23023  __pyx_type___pyx_array.tp_print = 0;
23024  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23025  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23026  __pyx_array_type = &__pyx_type___pyx_array;
23027  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23028  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23029  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23030  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23031  }
23032  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23033  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23034  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23035  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23036  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23037  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23038  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23039  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23040  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23041  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23042  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23043  __pyx_type___pyx_memoryview.tp_print = 0;
23044  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23045  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23046  }
23047  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23048  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23049  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23050  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23051  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23052  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23053  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23054  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23055  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23056  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23057  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23058  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23059  }
23060  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23061  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23062  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23063  __Pyx_RefNannyFinishContext();
23064  return 0;
23065  __pyx_L1_error:;
23066  __Pyx_RefNannyFinishContext();
23067  return -1;
23068 }
23069 
23070 static int __Pyx_modinit_type_import_code(void) {
23071  __Pyx_RefNannyDeclarations
23072  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23073  /*--- Type import code ---*/
23074  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
23075  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23076  sizeof(PyTypeObject),
23077  #else
23078  sizeof(PyHeapTypeObject),
23079  #endif
23080  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
23081  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 164, __pyx_L1_error)
23082  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 186, __pyx_L1_error)
23083  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 190, __pyx_L1_error)
23084  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 199, __pyx_L1_error)
23085  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 872, __pyx_L1_error)
23086  __Pyx_RefNannyFinishContext();
23087  return 0;
23088  __pyx_L1_error:;
23089  __Pyx_RefNannyFinishContext();
23090  return -1;
23091 }
23092 
23093 static int __Pyx_modinit_variable_import_code(void) {
23094  __Pyx_RefNannyDeclarations
23095  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23096  /*--- Variable import code ---*/
23097  __Pyx_RefNannyFinishContext();
23098  return 0;
23099 }
23100 
23101 static int __Pyx_modinit_function_import_code(void) {
23102  __Pyx_RefNannyDeclarations
23103  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23104  /*--- Function import code ---*/
23105  __Pyx_RefNannyFinishContext();
23106  return 0;
23107 }
23108 
23109 
23110 #if PY_MAJOR_VERSION < 3
23111 #ifdef CYTHON_NO_PYINIT_EXPORT
23112 #define __Pyx_PyMODINIT_FUNC void
23113 #else
23114 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23115 #endif
23116 #else
23117 #ifdef CYTHON_NO_PYINIT_EXPORT
23118 #define __Pyx_PyMODINIT_FUNC PyObject *
23119 #else
23120 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23121 #endif
23122 #endif
23123 #ifndef CYTHON_SMALL_CODE
23124 #if defined(__clang__)
23125  #define CYTHON_SMALL_CODE
23126 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
23127  #define CYTHON_SMALL_CODE __attribute__((cold))
23128 #else
23129  #define CYTHON_SMALL_CODE
23130 #endif
23131 #endif
23132 
23133 
23134 #if PY_MAJOR_VERSION < 3
23135 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
23136 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void)
23137 #else
23138 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
23139 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)
23140 #if CYTHON_PEP489_MULTI_PHASE_INIT
23141 {
23142  return PyModuleDef_Init(&__pyx_moduledef);
23143 }
23144 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
23145  PyObject *value = PyObject_GetAttrString(spec, from_name);
23146  int result = 0;
23147  if (likely(value)) {
23148  result = PyDict_SetItemString(moddict, to_name, value);
23149  Py_DECREF(value);
23150  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23151  PyErr_Clear();
23152  } else {
23153  result = -1;
23154  }
23155  return result;
23156 }
23157 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23158  PyObject *module = NULL, *moddict, *modname;
23159  if (__pyx_m)
23160  return __Pyx_NewRef(__pyx_m);
23161  modname = PyObject_GetAttrString(spec, "name");
23162  if (unlikely(!modname)) goto bad;
23163  module = PyModule_NewObject(modname);
23164  Py_DECREF(modname);
23165  if (unlikely(!module)) goto bad;
23166  moddict = PyModule_GetDict(module);
23167  if (unlikely(!moddict)) goto bad;
23168  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
23169  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
23170  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
23171  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
23172  return module;
23173 bad:
23174  Py_XDECREF(module);
23175  return NULL;
23176 }
23177 
23178 
23179 static int __pyx_pymod_exec_superluWrappers(PyObject *__pyx_pyinit_module)
23180 #endif
23181 #endif
23182 {
23183  PyObject *__pyx_t_1 = NULL;
23184  PyObject *__pyx_t_2 = NULL;
23185  PyObject *__pyx_t_3 = NULL;
23186  static PyThread_type_lock __pyx_t_4[8];
23187  __Pyx_RefNannyDeclarations
23188  #if CYTHON_PEP489_MULTI_PHASE_INIT
23189  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
23190  #elif PY_MAJOR_VERSION >= 3
23191  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23192  #endif
23193  #if CYTHON_REFNANNY
23194 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23195 if (!__Pyx_RefNanny) {
23196  PyErr_Clear();
23197  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23198  if (!__Pyx_RefNanny)
23199  Py_FatalError("failed to import 'refnanny' module");
23200 }
23201 #endif
23202  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)", 0);
23203  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23204  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23205  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23206  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23207  #ifdef __Pyx_CyFunction_USED
23208  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23209  #endif
23210  #ifdef __Pyx_FusedFunction_USED
23211  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23212  #endif
23213  #ifdef __Pyx_Coroutine_USED
23214  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23215  #endif
23216  #ifdef __Pyx_Generator_USED
23217  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23218  #endif
23219  #ifdef __Pyx_AsyncGen_USED
23220  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23221  #endif
23222  #ifdef __Pyx_StopAsyncIteration_USED
23223  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23224  #endif
23225  /*--- Library function declarations ---*/
23226  /*--- Threads initialization code ---*/
23227  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23228  #ifdef WITH_THREAD /* Python build with threading support? */
23229  PyEval_InitThreads();
23230  #endif
23231  #endif
23232  /*--- Module creation code ---*/
23233  #if CYTHON_PEP489_MULTI_PHASE_INIT
23234  __pyx_m = __pyx_pyinit_module;
23235  Py_INCREF(__pyx_m);
23236  #else
23237  #if PY_MAJOR_VERSION < 3
23238  __pyx_m = Py_InitModule4("superluWrappers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23239  #else
23240  __pyx_m = PyModule_Create(&__pyx_moduledef);
23241  #endif
23242  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23243  #endif
23244  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23245  Py_INCREF(__pyx_d);
23246  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23247  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23248  #if CYTHON_COMPILING_IN_PYPY
23249  Py_INCREF(__pyx_b);
23250  #endif
23251  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23252  /*--- Initialize various global constants etc. ---*/
23253  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23254  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23255  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23256  #endif
23257  if (__pyx_module_is_main_superluWrappers) {
23258  if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23259  }
23260  #if PY_MAJOR_VERSION >= 3
23261  {
23262  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23263  if (!PyDict_GetItemString(modules, "superluWrappers")) {
23264  if (unlikely(PyDict_SetItemString(modules, "superluWrappers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23265  }
23266  }
23267  #endif
23268  /*--- Builtin init code ---*/
23269  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23270  /*--- Constants init code ---*/
23271  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23272  /*--- Global type/function init code ---*/
23273  (void)__Pyx_modinit_global_init_code();
23274  (void)__Pyx_modinit_variable_export_code();
23275  (void)__Pyx_modinit_function_export_code();
23276  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
23277  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
23278  (void)__Pyx_modinit_variable_import_code();
23279  (void)__Pyx_modinit_function_import_code();
23280  /*--- Execution code ---*/
23281  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23282  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23283  #endif
23284 
23285  /* "superluWrappers.pyx":7
23286  * # correctly. perhaps they should only be enabled when not in debug mode?
23287  *
23288  * import numpy as np # <<<<<<<<<<<<<<
23289  * import cython
23290  * cimport numpy as np
23291  */
23292  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
23293  __Pyx_GOTREF(__pyx_t_1);
23294  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
23295  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23296 
23297  /* "superluWrappers.pyx":13
23298  * from libc.stdlib cimport malloc
23299  *
23300  * class SparseMatrix(object): # <<<<<<<<<<<<<<
23301  *
23302  * def __init__(self,
23303  */
23304  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__36); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
23305  __Pyx_GOTREF(__pyx_t_1);
23306  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__36, __pyx_n_s_SparseMatrix, __pyx_n_s_SparseMatrix, (PyObject *) NULL, __pyx_n_s_superluWrappers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
23307  __Pyx_GOTREF(__pyx_t_2);
23308 
23309  /* "superluWrappers.pyx":15
23310  * class SparseMatrix(object):
23311  *
23312  * def __init__(self, # <<<<<<<<<<<<<<
23313  * nr,
23314  * nc,
23315  */
23316  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_1__init__, 0, __pyx_n_s_SparseMatrix___init, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
23317  __Pyx_GOTREF(__pyx_t_3);
23318  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
23319  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23320 
23321  /* "superluWrappers.pyx":35
23322  * self.rowptr)
23323  *
23324  * def matvec(self, x, y): # <<<<<<<<<<<<<<
23325  * """
23326  * Compute the sparse matrix-vector product y = Ax
23327  */
23328  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_3matvec, 0, __pyx_n_s_SparseMatrix_matvec, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
23329  __Pyx_GOTREF(__pyx_t_3);
23330  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_matvec, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
23331  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23332 
23333  /* "superluWrappers.pyx":46
23334  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
23335  *
23336  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
23337  * """ Write the sparse matrix to a file
23338  *
23339  */
23340  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite, 0, __pyx_n_s_SparseMatrix_fwrite, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error)
23341  __Pyx_GOTREF(__pyx_t_3);
23342  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_fwrite, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
23343  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23344 
23345  /* "superluWrappers.pyx":62
23346  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
23347  *
23348  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
23349  * """ Get the CSR representation of the sparse matrix.
23350  *
23351  */
23352  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getCSRrepresentatio, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
23353  __Pyx_GOTREF(__pyx_t_3);
23354  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
23355  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23356 
23357  /* "superluWrappers.pyx":72
23358  * return (self.rowptr, self.colind, self.nzvals)
23359  *
23360  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
23361  * range_start,
23362  * range_end):
23363  */
23364  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getSubMatCSRreprese, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
23365  __Pyx_GOTREF(__pyx_t_3);
23366  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSubMatCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
23367  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23368 
23369  /* "superluWrappers.pyx":13
23370  * from libc.stdlib cimport malloc
23371  *
23372  * class SparseMatrix(object): # <<<<<<<<<<<<<<
23373  *
23374  * def __init__(self,
23375  */
23376  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SparseMatrix, __pyx_tuple__36, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error)
23377  __Pyx_GOTREF(__pyx_t_3);
23378  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SparseMatrix, __pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
23379  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23380  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23381  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23382 
23383  /* "superluWrappers.pyx":219
23384  * self.X.Store = &self.storeX
23385  *
23386  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
23387  * sparseFactor):
23388  * """ Python wrapper for superlu Sparse Factor Prepare function.
23389  */
23390  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_1sparseFactorPrepare, NULL, __pyx_n_s_superluWrappers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
23391  __Pyx_GOTREF(__pyx_t_1);
23392  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorPrepare, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
23393  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23394 
23395  /* "superluWrappers.pyx":286
23396  * &info)
23397  *
23398  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
23399  * x):
23400  * """ Sparse factor solve wrappers
23401  */
23402  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_3sparseFactorSolve, NULL, __pyx_n_s_superluWrappers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
23403  __Pyx_GOTREF(__pyx_t_1);
23404  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorSolve, __pyx_t_1) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
23405  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23406 
23407  /* "superluWrappers.pyx":1
23408  * #cython: boundscheck=False, wraparound=False, nonecheck=False, initializedcheck=False # <<<<<<<<<<<<<<
23409  *
23410  * # ARB - the cython directives above allow code to run much faster. it is worth noting
23411  */
23412  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23413  __Pyx_GOTREF(__pyx_t_1);
23414  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23415  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23416 
23417  /* "View.MemoryView":208
23418  * info.obj = self
23419  *
23420  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23421  *
23422  * def __dealloc__(array self):
23423  */
23424  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error)
23425  __Pyx_GOTREF(__pyx_t_1);
23426  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
23427  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23428  PyType_Modified(__pyx_array_type);
23429 
23430  /* "View.MemoryView":285
23431  * return self.name
23432  *
23433  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23434  * cdef strided = Enum("<strided and direct>") # default
23435  * cdef indirect = Enum("<strided and indirect>")
23436  */
23437  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 285, __pyx_L1_error)
23438  __Pyx_GOTREF(__pyx_t_1);
23439  __Pyx_XGOTREF(generic);
23440  __Pyx_DECREF_SET(generic, __pyx_t_1);
23441  __Pyx_GIVEREF(__pyx_t_1);
23442  __pyx_t_1 = 0;
23443 
23444  /* "View.MemoryView":286
23445  *
23446  * cdef generic = Enum("<strided and direct or indirect>")
23447  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23448  * cdef indirect = Enum("<strided and indirect>")
23449  *
23450  */
23451  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23452  __Pyx_GOTREF(__pyx_t_1);
23453  __Pyx_XGOTREF(strided);
23454  __Pyx_DECREF_SET(strided, __pyx_t_1);
23455  __Pyx_GIVEREF(__pyx_t_1);
23456  __pyx_t_1 = 0;
23457 
23458  /* "View.MemoryView":287
23459  * cdef generic = Enum("<strided and direct or indirect>")
23460  * cdef strided = Enum("<strided and direct>") # default
23461  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23462  *
23463  *
23464  */
23465  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23466  __Pyx_GOTREF(__pyx_t_1);
23467  __Pyx_XGOTREF(indirect);
23468  __Pyx_DECREF_SET(indirect, __pyx_t_1);
23469  __Pyx_GIVEREF(__pyx_t_1);
23470  __pyx_t_1 = 0;
23471 
23472  /* "View.MemoryView":290
23473  *
23474  *
23475  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23476  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23477  *
23478  */
23479  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
23480  __Pyx_GOTREF(__pyx_t_1);
23481  __Pyx_XGOTREF(contiguous);
23482  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23483  __Pyx_GIVEREF(__pyx_t_1);
23484  __pyx_t_1 = 0;
23485 
23486  /* "View.MemoryView":291
23487  *
23488  * cdef contiguous = Enum("<contiguous and direct>")
23489  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23490  *
23491  *
23492  */
23493  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23494  __Pyx_GOTREF(__pyx_t_1);
23495  __Pyx_XGOTREF(indirect_contiguous);
23496  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23497  __Pyx_GIVEREF(__pyx_t_1);
23498  __pyx_t_1 = 0;
23499 
23500  /* "View.MemoryView":315
23501  *
23502  * DEF THREAD_LOCKS_PREALLOCATED = 8
23503  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23504  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23505  * PyThread_allocate_lock(),
23506  */
23507  __pyx_memoryview_thread_locks_used = 0;
23508 
23509  /* "View.MemoryView":316
23510  * DEF THREAD_LOCKS_PREALLOCATED = 8
23511  * cdef int __pyx_memoryview_thread_locks_used = 0
23512  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23513  * PyThread_allocate_lock(),
23514  * PyThread_allocate_lock(),
23515  */
23516  __pyx_t_4[0] = PyThread_allocate_lock();
23517  __pyx_t_4[1] = PyThread_allocate_lock();
23518  __pyx_t_4[2] = PyThread_allocate_lock();
23519  __pyx_t_4[3] = PyThread_allocate_lock();
23520  __pyx_t_4[4] = PyThread_allocate_lock();
23521  __pyx_t_4[5] = PyThread_allocate_lock();
23522  __pyx_t_4[6] = PyThread_allocate_lock();
23523  __pyx_t_4[7] = PyThread_allocate_lock();
23524  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23525 
23526  /* "View.MemoryView":544
23527  * info.obj = self
23528  *
23529  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23530  *
23531  *
23532  */
23533  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 544, __pyx_L1_error)
23534  __Pyx_GOTREF(__pyx_t_1);
23535  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 544, __pyx_L1_error)
23536  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23537  PyType_Modified(__pyx_memoryview_type);
23538 
23539  /* "View.MemoryView":990
23540  * return self.from_object
23541  *
23542  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23543  *
23544  *
23545  */
23546  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 990, __pyx_L1_error)
23547  __Pyx_GOTREF(__pyx_t_1);
23548  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 990, __pyx_L1_error)
23549  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23550  PyType_Modified(__pyx_memoryviewslice_type);
23551 
23552  /* "(tree fragment)":1
23553  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23554  * if __pyx_checksum != 0xb068931:
23555  * from pickle import PickleError as __pyx_PickleError
23556  */
23557  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23558  __Pyx_GOTREF(__pyx_t_1);
23559  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23560  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23561 
23562  /* "(tree fragment)":9
23563  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23564  * return __pyx_result
23565  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23566  * __pyx_result.name = __pyx_state[0]
23567  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23568  */
23569 
23570  /*--- Wrapped vars code ---*/
23571 
23572  goto __pyx_L0;
23573  __pyx_L1_error:;
23574  __Pyx_XDECREF(__pyx_t_1);
23575  __Pyx_XDECREF(__pyx_t_2);
23576  __Pyx_XDECREF(__pyx_t_3);
23577  if (__pyx_m) {
23578  if (__pyx_d) {
23579  __Pyx_AddTraceback("init superluWrappers", 0, __pyx_lineno, __pyx_filename);
23580  }
23581  Py_DECREF(__pyx_m); __pyx_m = 0;
23582  } else if (!PyErr_Occurred()) {
23583  PyErr_SetString(PyExc_ImportError, "init superluWrappers");
23584  }
23585  __pyx_L0:;
23586  __Pyx_RefNannyFinishContext();
23587  #if CYTHON_PEP489_MULTI_PHASE_INIT
23588  return (__pyx_m != NULL) ? 0 : -1;
23589  #elif PY_MAJOR_VERSION >= 3
23590  return __pyx_m;
23591  #else
23592  return;
23593  #endif
23594 }
23595 
23596 /* --- Runtime support code --- */
23597 /* Refnanny */
23598 #if CYTHON_REFNANNY
23599 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23600  PyObject *m = NULL, *p = NULL;
23601  void *r = NULL;
23602  m = PyImport_ImportModule((char *)modname);
23603  if (!m) goto end;
23604  p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
23605  if (!p) goto end;
23606  r = PyLong_AsVoidPtr(p);
23607 end:
23608  Py_XDECREF(p);
23609  Py_XDECREF(m);
23610  return (__Pyx_RefNannyAPIStruct *)r;
23611 }
23612 #endif
23613 
23614 /* PyObjectGetAttrStr */
23615 #if CYTHON_USE_TYPE_SLOTS
23616 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23617  PyTypeObject* tp = Py_TYPE(obj);
23618  if (likely(tp->tp_getattro))
23619  return tp->tp_getattro(obj, attr_name);
23620 #if PY_MAJOR_VERSION < 3
23621  if (likely(tp->tp_getattr))
23622  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23623 #endif
23624  return PyObject_GetAttr(obj, attr_name);
23625 }
23626 #endif
23627 
23628 /* GetBuiltinName */
23629 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23630  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23631  if (unlikely(!result)) {
23632  PyErr_Format(PyExc_NameError,
23633 #if PY_MAJOR_VERSION >= 3
23634  "name '%U' is not defined", name);
23635 #else
23636  "name '%.200s' is not defined", PyString_AS_STRING(name));
23637 #endif
23638  }
23639  return result;
23640 }
23641 
23642 /* RaiseArgTupleInvalid */
23643 static void __Pyx_RaiseArgtupleInvalid(
23644  const char* func_name,
23645  int exact,
23646  Py_ssize_t num_min,
23647  Py_ssize_t num_max,
23648  Py_ssize_t num_found)
23649 {
23650  Py_ssize_t num_expected;
23651  const char *more_or_less;
23652  if (num_found < num_min) {
23653  num_expected = num_min;
23654  more_or_less = "at least";
23655  } else {
23656  num_expected = num_max;
23657  more_or_less = "at most";
23658  }
23659  if (exact) {
23660  more_or_less = "exactly";
23661  }
23662  PyErr_Format(PyExc_TypeError,
23663  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23664  func_name, more_or_less, num_expected,
23665  (num_expected == 1) ? "" : "s", num_found);
23666 }
23667 
23668 /* RaiseDoubleKeywords */
23669 static void __Pyx_RaiseDoubleKeywordsError(
23670  const char* func_name,
23671  PyObject* kw_name)
23672 {
23673  PyErr_Format(PyExc_TypeError,
23674  #if PY_MAJOR_VERSION >= 3
23675  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23676  #else
23677  "%s() got multiple values for keyword argument '%s'", func_name,
23678  PyString_AsString(kw_name));
23679  #endif
23680 }
23681 
23682 /* ParseKeywords */
23683 static int __Pyx_ParseOptionalKeywords(
23684  PyObject *kwds,
23685  PyObject **argnames[],
23686  PyObject *kwds2,
23687  PyObject *values[],
23688  Py_ssize_t num_pos_args,
23689  const char* function_name)
23690 {
23691  PyObject *key = 0, *value = 0;
23692  Py_ssize_t pos = 0;
23693  PyObject*** name;
23694  PyObject*** first_kw_arg = argnames + num_pos_args;
23695  while (PyDict_Next(kwds, &pos, &key, &value)) {
23696  name = first_kw_arg;
23697  while (*name && (**name != key)) name++;
23698  if (*name) {
23699  values[name-argnames] = value;
23700  continue;
23701  }
23702  name = first_kw_arg;
23703  #if PY_MAJOR_VERSION < 3
23704  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
23705  while (*name) {
23706  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23707  && _PyString_Eq(**name, key)) {
23708  values[name-argnames] = value;
23709  break;
23710  }
23711  name++;
23712  }
23713  if (*name) continue;
23714  else {
23715  PyObject*** argname = argnames;
23716  while (argname != first_kw_arg) {
23717  if ((**argname == key) || (
23718  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23719  && _PyString_Eq(**argname, key))) {
23720  goto arg_passed_twice;
23721  }
23722  argname++;
23723  }
23724  }
23725  } else
23726  #endif
23727  if (likely(PyUnicode_Check(key))) {
23728  while (*name) {
23729  int cmp = (**name == key) ? 0 :
23730  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23731  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
23732  #endif
23733  PyUnicode_Compare(**name, key);
23734  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23735  if (cmp == 0) {
23736  values[name-argnames] = value;
23737  break;
23738  }
23739  name++;
23740  }
23741  if (*name) continue;
23742  else {
23743  PyObject*** argname = argnames;
23744  while (argname != first_kw_arg) {
23745  int cmp = (**argname == key) ? 0 :
23746  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23747  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
23748  #endif
23749  PyUnicode_Compare(**argname, key);
23750  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23751  if (cmp == 0) goto arg_passed_twice;
23752  argname++;
23753  }
23754  }
23755  } else
23756  goto invalid_keyword_type;
23757  if (kwds2) {
23758  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23759  } else {
23760  goto invalid_keyword;
23761  }
23762  }
23763  return 0;
23764 arg_passed_twice:
23765  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23766  goto bad;
23767 invalid_keyword_type:
23768  PyErr_Format(PyExc_TypeError,
23769  "%.200s() keywords must be strings", function_name);
23770  goto bad;
23771 invalid_keyword:
23772  PyErr_Format(PyExc_TypeError,
23773  #if PY_MAJOR_VERSION < 3
23774  "%.200s() got an unexpected keyword argument '%.200s'",
23775  function_name, PyString_AsString(key));
23776  #else
23777  "%s() got an unexpected keyword argument '%U'",
23778  function_name, key);
23779  #endif
23780 bad:
23781  return -1;
23782 }
23783 
23784 /* PyObjectSetAttrStr */
23785 #if CYTHON_USE_TYPE_SLOTS
23786 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
23787  PyTypeObject* tp = Py_TYPE(obj);
23788  if (likely(tp->tp_setattro))
23789  return tp->tp_setattro(obj, attr_name, value);
23790 #if PY_MAJOR_VERSION < 3
23791  if (likely(tp->tp_setattr))
23792  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
23793 #endif
23794  return PyObject_SetAttr(obj, attr_name, value);
23795 }
23796 #endif
23797 
23798 /* PyObjectCall */
23799 #if CYTHON_COMPILING_IN_CPYTHON
23800 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23801  PyObject *result;
23802  ternaryfunc call = func->ob_type->tp_call;
23803  if (unlikely(!call))
23804  return PyObject_Call(func, arg, kw);
23805  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23806  return NULL;
23807  result = (*call)(func, arg, kw);
23808  Py_LeaveRecursiveCall();
23809  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23810  PyErr_SetString(
23811  PyExc_SystemError,
23812  "NULL result without error in PyObject_Call");
23813  }
23814  return result;
23815 }
23816 #endif
23817 
23818 /* ExtTypeTest */
23819 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
23820  if (unlikely(!type)) {
23821  PyErr_SetString(PyExc_SystemError, "Missing type object");
23822  return 0;
23823  }
23824  if (likely(__Pyx_TypeCheck(obj, type)))
23825  return 1;
23826  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
23827  Py_TYPE(obj)->tp_name, type->tp_name);
23828  return 0;
23829 }
23830 
23831 /* MemviewSliceInit */
23832 static int
23833 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
23834  int ndim,
23835  __Pyx_memviewslice *memviewslice,
23836  int memview_is_new_reference)
23837 {
23838  __Pyx_RefNannyDeclarations
23839  int i, retval=-1;
23840  Py_buffer *buf = &memview->view;
23841  __Pyx_RefNannySetupContext("init_memviewslice", 0);
23842  if (!buf) {
23843  PyErr_SetString(PyExc_ValueError,
23844  "buf is NULL.");
23845  goto fail;
23846  } else if (memviewslice->memview || memviewslice->data) {
23847  PyErr_SetString(PyExc_ValueError,
23848  "memviewslice is already initialized!");
23849  goto fail;
23850  }
23851  if (buf->strides) {
23852  for (i = 0; i < ndim; i++) {
23853  memviewslice->strides[i] = buf->strides[i];
23854  }
23855  } else {
23856  Py_ssize_t stride = buf->itemsize;
23857  for (i = ndim - 1; i >= 0; i--) {
23858  memviewslice->strides[i] = stride;
23859  stride *= buf->shape[i];
23860  }
23861  }
23862  for (i = 0; i < ndim; i++) {
23863  memviewslice->shape[i] = buf->shape[i];
23864  if (buf->suboffsets) {
23865  memviewslice->suboffsets[i] = buf->suboffsets[i];
23866  } else {
23867  memviewslice->suboffsets[i] = -1;
23868  }
23869  }
23870  memviewslice->memview = memview;
23871  memviewslice->data = (char *)buf->buf;
23872  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
23873  Py_INCREF(memview);
23874  }
23875  retval = 0;
23876  goto no_fail;
23877 fail:
23878  memviewslice->memview = 0;
23879  memviewslice->data = 0;
23880  retval = -1;
23881 no_fail:
23882  __Pyx_RefNannyFinishContext();
23883  return retval;
23884 }
23885 #ifndef Py_NO_RETURN
23886 #define Py_NO_RETURN
23887 #endif
23888 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
23889  va_list vargs;
23890  char msg[200];
23891 #ifdef HAVE_STDARG_PROTOTYPES
23892  va_start(vargs, fmt);
23893 #else
23894  va_start(vargs);
23895 #endif
23896  vsnprintf(msg, 200, fmt, vargs);
23897  va_end(vargs);
23898  Py_FatalError(msg);
23899 }
23900 static CYTHON_INLINE int
23901 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23902  PyThread_type_lock lock)
23903 {
23904  int result;
23905  PyThread_acquire_lock(lock, 1);
23906  result = (*acquisition_count)++;
23907  PyThread_release_lock(lock);
23908  return result;
23909 }
23910 static CYTHON_INLINE int
23911 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23912  PyThread_type_lock lock)
23913 {
23914  int result;
23915  PyThread_acquire_lock(lock, 1);
23916  result = (*acquisition_count)--;
23917  PyThread_release_lock(lock);
23918  return result;
23919 }
23920 static CYTHON_INLINE void
23921 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
23922 {
23923  int first_time;
23924  struct __pyx_memoryview_obj *memview = memslice->memview;
23925  if (!memview || (PyObject *) memview == Py_None)
23926  return;
23927  if (__pyx_get_slice_count(memview) < 0)
23928  __pyx_fatalerror("Acquisition count is %d (line %d)",
23929  __pyx_get_slice_count(memview), lineno);
23930  first_time = __pyx_add_acquisition_count(memview) == 0;
23931  if (first_time) {
23932  if (have_gil) {
23933  Py_INCREF((PyObject *) memview);
23934  } else {
23935  PyGILState_STATE _gilstate = PyGILState_Ensure();
23936  Py_INCREF((PyObject *) memview);
23937  PyGILState_Release(_gilstate);
23938  }
23939  }
23940 }
23941 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
23942  int have_gil, int lineno) {
23943  int last_time;
23944  struct __pyx_memoryview_obj *memview = memslice->memview;
23945  if (!memview ) {
23946  return;
23947  } else if ((PyObject *) memview == Py_None) {
23948  memslice->memview = NULL;
23949  return;
23950  }
23951  if (__pyx_get_slice_count(memview) <= 0)
23952  __pyx_fatalerror("Acquisition count is %d (line %d)",
23953  __pyx_get_slice_count(memview), lineno);
23954  last_time = __pyx_sub_acquisition_count(memview) == 1;
23955  memslice->data = NULL;
23956  if (last_time) {
23957  if (have_gil) {
23958  Py_CLEAR(memslice->memview);
23959  } else {
23960  PyGILState_STATE _gilstate = PyGILState_Ensure();
23961  Py_CLEAR(memslice->memview);
23962  PyGILState_Release(_gilstate);
23963  }
23964  } else {
23965  memslice->memview = NULL;
23966  }
23967 }
23968 
23969 /* PyCFunctionFastCall */
23970 #if CYTHON_FAST_PYCCALL
23971 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23972  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23973  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23974  PyObject *self = PyCFunction_GET_SELF(func);
23975  int flags = PyCFunction_GET_FLAGS(func);
23976  assert(PyCFunction_Check(func));
23977  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
23978  assert(nargs >= 0);
23979  assert(nargs == 0 || args != NULL);
23980  /* _PyCFunction_FastCallDict() must not be called with an exception set,
23981  because it may clear it (directly or indirectly) and so the
23982  caller loses its exception */
23983  assert(!PyErr_Occurred());
23984  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23985  return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
23986  } else {
23987  return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
23988  }
23989 }
23990 #endif
23991 
23992 /* PyFunctionFastCall */
23993 #if CYTHON_FAST_PYCALL
23994 #include "frameobject.h"
23995 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23996  PyObject *globals) {
23997  PyFrameObject *f;
23998  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23999  PyObject **fastlocals;
24000  Py_ssize_t i;
24001  PyObject *result;
24002  assert(globals != NULL);
24003  /* XXX Perhaps we should create a specialized
24004  PyFrame_New() that doesn't take locals, but does
24005  take builtins without sanity checking them.
24006  */
24007  assert(tstate != NULL);
24008  f = PyFrame_New(tstate, co, globals, NULL);
24009  if (f == NULL) {
24010  return NULL;
24011  }
24012  fastlocals = f->f_localsplus;
24013  for (i = 0; i < na; i++) {
24014  Py_INCREF(*args);
24015  fastlocals[i] = *args++;
24016  }
24017  result = PyEval_EvalFrameEx(f,0);
24018  ++tstate->recursion_depth;
24019  Py_DECREF(f);
24020  --tstate->recursion_depth;
24021  return result;
24022 }
24023 #if 1 || PY_VERSION_HEX < 0x030600B1
24024 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
24025  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24026  PyObject *globals = PyFunction_GET_GLOBALS(func);
24027  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24028  PyObject *closure;
24029 #if PY_MAJOR_VERSION >= 3
24030  PyObject *kwdefs;
24031 #endif
24032  PyObject *kwtuple, **k;
24033  PyObject **d;
24034  Py_ssize_t nd;
24035  Py_ssize_t nk;
24036  PyObject *result;
24037  assert(kwargs == NULL || PyDict_Check(kwargs));
24038  nk = kwargs ? PyDict_Size(kwargs) : 0;
24039  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24040  return NULL;
24041  }
24042  if (
24043 #if PY_MAJOR_VERSION >= 3
24044  co->co_kwonlyargcount == 0 &&
24045 #endif
24046  likely(kwargs == NULL || nk == 0) &&
24047  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24048  if (argdefs == NULL && co->co_argcount == nargs) {
24049  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24050  goto done;
24051  }
24052  else if (nargs == 0 && argdefs != NULL
24053  && co->co_argcount == Py_SIZE(argdefs)) {
24054  /* function called with no arguments, but all parameters have
24055  a default value: use default values as arguments .*/
24056  args = &PyTuple_GET_ITEM(argdefs, 0);
24057  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24058  goto done;
24059  }
24060  }
24061  if (kwargs != NULL) {
24062  Py_ssize_t pos, i;
24063  kwtuple = PyTuple_New(2 * nk);
24064  if (kwtuple == NULL) {
24065  result = NULL;
24066  goto done;
24067  }
24068  k = &PyTuple_GET_ITEM(kwtuple, 0);
24069  pos = i = 0;
24070  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24071  Py_INCREF(k[i]);
24072  Py_INCREF(k[i+1]);
24073  i += 2;
24074  }
24075  nk = i / 2;
24076  }
24077  else {
24078  kwtuple = NULL;
24079  k = NULL;
24080  }
24081  closure = PyFunction_GET_CLOSURE(func);
24082 #if PY_MAJOR_VERSION >= 3
24083  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24084 #endif
24085  if (argdefs != NULL) {
24086  d = &PyTuple_GET_ITEM(argdefs, 0);
24087  nd = Py_SIZE(argdefs);
24088  }
24089  else {
24090  d = NULL;
24091  nd = 0;
24092  }
24093 #if PY_MAJOR_VERSION >= 3
24094  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24095  args, nargs,
24096  k, (int)nk,
24097  d, (int)nd, kwdefs, closure);
24098 #else
24099  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24100  args, nargs,
24101  k, (int)nk,
24102  d, (int)nd, closure);
24103 #endif
24104  Py_XDECREF(kwtuple);
24105 done:
24106  Py_LeaveRecursiveCall();
24107  return result;
24108 }
24109 #endif
24110 #endif
24111 
24112 /* PyObjectCallMethO */
24113 #if CYTHON_COMPILING_IN_CPYTHON
24114 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24115  PyObject *self, *result;
24116  PyCFunction cfunc;
24117  cfunc = PyCFunction_GET_FUNCTION(func);
24118  self = PyCFunction_GET_SELF(func);
24119  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24120  return NULL;
24121  result = cfunc(self, arg);
24122  Py_LeaveRecursiveCall();
24123  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24124  PyErr_SetString(
24125  PyExc_SystemError,
24126  "NULL result without error in PyObject_Call");
24127  }
24128  return result;
24129 }
24130 #endif
24131 
24132 /* PyObjectCallOneArg */
24133 #if CYTHON_COMPILING_IN_CPYTHON
24134 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24135  PyObject *result;
24136  PyObject *args = PyTuple_New(1);
24137  if (unlikely(!args)) return NULL;
24138  Py_INCREF(arg);
24139  PyTuple_SET_ITEM(args, 0, arg);
24140  result = __Pyx_PyObject_Call(func, args, NULL);
24141  Py_DECREF(args);
24142  return result;
24143 }
24144 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24145 #if CYTHON_FAST_PYCALL
24146  if (PyFunction_Check(func)) {
24147  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24148  }
24149 #endif
24150  if (likely(PyCFunction_Check(func))) {
24151  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24152  return __Pyx_PyObject_CallMethO(func, arg);
24153 #if CYTHON_FAST_PYCCALL
24154  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24155  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24156 #endif
24157  }
24158  }
24159  return __Pyx__PyObject_CallOneArg(func, arg);
24160 }
24161 #else
24162 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24163  PyObject *result;
24164  PyObject *args = PyTuple_Pack(1, arg);
24165  if (unlikely(!args)) return NULL;
24166  result = __Pyx_PyObject_Call(func, args, NULL);
24167  Py_DECREF(args);
24168  return result;
24169 }
24170 #endif
24171 
24172 /* PyObjectCallNoArg */
24173 #if CYTHON_COMPILING_IN_CPYTHON
24174 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24175 #if CYTHON_FAST_PYCALL
24176  if (PyFunction_Check(func)) {
24177  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24178  }
24179 #endif
24180 #ifdef __Pyx_CyFunction_USED
24181  if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
24182 #else
24183  if (likely(PyCFunction_Check(func))) {
24184 #endif
24185  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24186  return __Pyx_PyObject_CallMethO(func, NULL);
24187  }
24188  }
24189  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24190 }
24191 #endif
24192 
24193 /* GetItemInt */
24194  static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24195  PyObject *r;
24196  if (!j) return NULL;
24197  r = PyObject_GetItem(o, j);
24198  Py_DECREF(j);
24199  return r;
24200 }
24201 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24202  CYTHON_NCP_UNUSED int wraparound,
24203  CYTHON_NCP_UNUSED int boundscheck) {
24204 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24205  Py_ssize_t wrapped_i = i;
24206  if (wraparound & unlikely(i < 0)) {
24207  wrapped_i += PyList_GET_SIZE(o);
24208  }
24209  if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
24210  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24211  Py_INCREF(r);
24212  return r;
24213  }
24214  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24215 #else
24216  return PySequence_GetItem(o, i);
24217 #endif
24218 }
24219 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24220  CYTHON_NCP_UNUSED int wraparound,
24221  CYTHON_NCP_UNUSED int boundscheck) {
24222 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24223  Py_ssize_t wrapped_i = i;
24224  if (wraparound & unlikely(i < 0)) {
24225  wrapped_i += PyTuple_GET_SIZE(o);
24226  }
24227  if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
24228  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24229  Py_INCREF(r);
24230  return r;
24231  }
24232  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24233 #else
24234  return PySequence_GetItem(o, i);
24235 #endif
24236 }
24237 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24238  CYTHON_NCP_UNUSED int wraparound,
24239  CYTHON_NCP_UNUSED int boundscheck) {
24240 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24241  if (is_list || PyList_CheckExact(o)) {
24242  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24243  if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
24244  PyObject *r = PyList_GET_ITEM(o, n);
24245  Py_INCREF(r);
24246  return r;
24247  }
24248  }
24249  else if (PyTuple_CheckExact(o)) {
24250  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24251  if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
24252  PyObject *r = PyTuple_GET_ITEM(o, n);
24253  Py_INCREF(r);
24254  return r;
24255  }
24256  } else {
24257  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24258  if (likely(m && m->sq_item)) {
24259  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24260  Py_ssize_t l = m->sq_length(o);
24261  if (likely(l >= 0)) {
24262  i += l;
24263  } else {
24264  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24265  return NULL;
24266  PyErr_Clear();
24267  }
24268  }
24269  return m->sq_item(o, i);
24270  }
24271  }
24272 #else
24273  if (is_list || PySequence_Check(o)) {
24274  return PySequence_GetItem(o, i);
24275  }
24276 #endif
24277  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24278 }
24279 
24280 /* ObjectGetItem */
24281  #if CYTHON_USE_TYPE_SLOTS
24282 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24283  PyObject *runerr;
24284  Py_ssize_t key_value;
24285  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24286  if (unlikely(!(m && m->sq_item))) {
24287  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24288  return NULL;
24289  }
24290  key_value = __Pyx_PyIndex_AsSsize_t(index);
24291  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24292  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24293  }
24294  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24295  PyErr_Clear();
24296  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24297  }
24298  return NULL;
24299 }
24300 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24301  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24302  if (likely(m && m->mp_subscript)) {
24303  return m->mp_subscript(obj, key);
24304  }
24305  return __Pyx_PyObject_GetIndex(obj, key);
24306 }
24307 #endif
24308 
24309 /* PyIntBinop */
24310  #if !CYTHON_COMPILING_IN_PYPY
24311 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
24312  #if PY_MAJOR_VERSION < 3
24313  if (likely(PyInt_CheckExact(op1))) {
24314  const long b = intval;
24315  long x;
24316  long a = PyInt_AS_LONG(op1);
24317  x = (long)((unsigned long)a + b);
24318  if (likely((x^a) >= 0 || (x^b) >= 0))
24319  return PyInt_FromLong(x);
24320  return PyLong_Type.tp_as_number->nb_add(op1, op2);
24321  }
24322  #endif
24323  #if CYTHON_USE_PYLONG_INTERNALS
24324  if (likely(PyLong_CheckExact(op1))) {
24325  const long b = intval;
24326  long a, x;
24327 #ifdef HAVE_LONG_LONG
24328  const PY_LONG_LONG llb = intval;
24329  PY_LONG_LONG lla, llx;
24330 #endif
24331  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24332  const Py_ssize_t size = Py_SIZE(op1);
24333  if (likely(__Pyx_sst_abs(size) <= 1)) {
24334  a = likely(size) ? digits[0] : 0;
24335  if (size == -1) a = -a;
24336  } else {
24337  switch (size) {
24338  case -2:
24339  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24340  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24341  break;
24342 #ifdef HAVE_LONG_LONG
24343  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24344  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24345  goto long_long;
24346 #endif
24347  }
24348  CYTHON_FALLTHROUGH;
24349  case 2:
24350  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24351  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24352  break;
24353 #ifdef HAVE_LONG_LONG
24354  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24355  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24356  goto long_long;
24357 #endif
24358  }
24359  CYTHON_FALLTHROUGH;
24360  case -3:
24361  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24362  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24363  break;
24364 #ifdef HAVE_LONG_LONG
24365  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24366  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24367  goto long_long;
24368 #endif
24369  }
24370  CYTHON_FALLTHROUGH;
24371  case 3:
24372  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24373  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24374  break;
24375 #ifdef HAVE_LONG_LONG
24376  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24377  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24378  goto long_long;
24379 #endif
24380  }
24381  CYTHON_FALLTHROUGH;
24382  case -4:
24383  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24384  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24385  break;
24386 #ifdef HAVE_LONG_LONG
24387  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24388  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24389  goto long_long;
24390 #endif
24391  }
24392  CYTHON_FALLTHROUGH;
24393  case 4:
24394  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24395  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24396  break;
24397 #ifdef HAVE_LONG_LONG
24398  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24399  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24400  goto long_long;
24401 #endif
24402  }
24403  CYTHON_FALLTHROUGH;
24404  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
24405  }
24406  }
24407  x = a + b;
24408  return PyLong_FromLong(x);
24409 #ifdef HAVE_LONG_LONG
24410  long_long:
24411  llx = lla + llb;
24412  return PyLong_FromLongLong(llx);
24413 #endif
24414 
24415 
24416  }
24417  #endif
24418  if (PyFloat_CheckExact(op1)) {
24419  const long b = intval;
24420  double a = PyFloat_AS_DOUBLE(op1);
24421  double result;
24422  PyFPE_START_PROTECT("add", return NULL)
24423  result = ((double)a) + (double)b;
24424  PyFPE_END_PROTECT(result)
24425  return PyFloat_FromDouble(result);
24426  }
24427  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24428 }
24429 #endif
24430 
24431 /* SaveResetException */
24432  #if CYTHON_FAST_THREAD_STATE
24433 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24434  #if PY_VERSION_HEX >= 0x030700A3
24435  *type = tstate->exc_state.exc_type;
24436  *value = tstate->exc_state.exc_value;
24437  *tb = tstate->exc_state.exc_traceback;
24438  #else
24439  *type = tstate->exc_type;
24440  *value = tstate->exc_value;
24441  *tb = tstate->exc_traceback;
24442  #endif
24443  Py_XINCREF(*type);
24444  Py_XINCREF(*value);
24445  Py_XINCREF(*tb);
24446 }
24447 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24448  PyObject *tmp_type, *tmp_value, *tmp_tb;
24449  #if PY_VERSION_HEX >= 0x030700A3
24450  tmp_type = tstate->exc_state.exc_type;
24451  tmp_value = tstate->exc_state.exc_value;
24452  tmp_tb = tstate->exc_state.exc_traceback;
24453  tstate->exc_state.exc_type = type;
24454  tstate->exc_state.exc_value = value;
24455  tstate->exc_state.exc_traceback = tb;
24456  #else
24457  tmp_type = tstate->exc_type;
24458  tmp_value = tstate->exc_value;
24459  tmp_tb = tstate->exc_traceback;
24460  tstate->exc_type = type;
24461  tstate->exc_value = value;
24462  tstate->exc_traceback = tb;
24463  #endif
24464  Py_XDECREF(tmp_type);
24465  Py_XDECREF(tmp_value);
24466  Py_XDECREF(tmp_tb);
24467 }
24468 #endif
24469 
24470 /* GetException */
24471  #if CYTHON_FAST_THREAD_STATE
24472 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24473 #else
24474 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
24475 #endif
24476  PyObject *local_type, *local_value, *local_tb;
24477 #if CYTHON_FAST_THREAD_STATE
24478  PyObject *tmp_type, *tmp_value, *tmp_tb;
24479  local_type = tstate->curexc_type;
24480  local_value = tstate->curexc_value;
24481  local_tb = tstate->curexc_traceback;
24482  tstate->curexc_type = 0;
24483  tstate->curexc_value = 0;
24484  tstate->curexc_traceback = 0;
24485 #else
24486  PyErr_Fetch(&local_type, &local_value, &local_tb);
24487 #endif
24488  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24489 #if CYTHON_FAST_THREAD_STATE
24490  if (unlikely(tstate->curexc_type))
24491 #else
24492  if (unlikely(PyErr_Occurred()))
24493 #endif
24494  goto bad;
24495  #if PY_MAJOR_VERSION >= 3
24496  if (local_tb) {
24497  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24498  goto bad;
24499  }
24500  #endif
24501  Py_XINCREF(local_tb);
24502  Py_XINCREF(local_type);
24503  Py_XINCREF(local_value);
24504  *type = local_type;
24505  *value = local_value;
24506  *tb = local_tb;
24507 #if CYTHON_FAST_THREAD_STATE
24508  #if PY_VERSION_HEX >= 0x030700A3
24509  tmp_type = tstate->exc_state.exc_type;
24510  tmp_value = tstate->exc_state.exc_value;
24511  tmp_tb = tstate->exc_state.exc_traceback;
24512  tstate->exc_state.exc_type = local_type;
24513  tstate->exc_state.exc_value = local_value;
24514  tstate->exc_state.exc_traceback = local_tb;
24515  #else
24516  tmp_type = tstate->exc_type;
24517  tmp_value = tstate->exc_value;
24518  tmp_tb = tstate->exc_traceback;
24519  tstate->exc_type = local_type;
24520  tstate->exc_value = local_value;
24521  tstate->exc_traceback = local_tb;
24522  #endif
24523  Py_XDECREF(tmp_type);
24524  Py_XDECREF(tmp_value);
24525  Py_XDECREF(tmp_tb);
24526 #else
24527  PyErr_SetExcInfo(local_type, local_value, local_tb);
24528 #endif
24529  return 0;
24530 bad:
24531  *type = 0;
24532  *value = 0;
24533  *tb = 0;
24534  Py_XDECREF(local_type);
24535  Py_XDECREF(local_value);
24536  Py_XDECREF(local_tb);
24537  return -1;
24538 }
24539 
24540 /* PyErrFetchRestore */
24541  #if CYTHON_FAST_THREAD_STATE
24542 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24543  PyObject *tmp_type, *tmp_value, *tmp_tb;
24544  tmp_type = tstate->curexc_type;
24545  tmp_value = tstate->curexc_value;
24546  tmp_tb = tstate->curexc_traceback;
24547  tstate->curexc_type = type;
24548  tstate->curexc_value = value;
24549  tstate->curexc_traceback = tb;
24550  Py_XDECREF(tmp_type);
24551  Py_XDECREF(tmp_value);
24552  Py_XDECREF(tmp_tb);
24553 }
24554 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24555  *type = tstate->curexc_type;
24556  *value = tstate->curexc_value;
24557  *tb = tstate->curexc_traceback;
24558  tstate->curexc_type = 0;
24559  tstate->curexc_value = 0;
24560  tstate->curexc_traceback = 0;
24561 }
24562 #endif
24563 
24564 /* SliceObject */
24565  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
24566  Py_ssize_t cstart, Py_ssize_t cstop,
24567  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
24568  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
24569 #if CYTHON_USE_TYPE_SLOTS
24570  PyMappingMethods* mp;
24571 #if PY_MAJOR_VERSION < 3
24572  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
24573  if (likely(ms && ms->sq_slice)) {
24574  if (!has_cstart) {
24575  if (_py_start && (*_py_start != Py_None)) {
24576  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
24577  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
24578  } else
24579  cstart = 0;
24580  }
24581  if (!has_cstop) {
24582  if (_py_stop && (*_py_stop != Py_None)) {
24583  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
24584  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
24585  } else
24586  cstop = PY_SSIZE_T_MAX;
24587  }
24588  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
24589  Py_ssize_t l = ms->sq_length(obj);
24590  if (likely(l >= 0)) {
24591  if (cstop < 0) {
24592  cstop += l;
24593  if (cstop < 0) cstop = 0;
24594  }
24595  if (cstart < 0) {
24596  cstart += l;
24597  if (cstart < 0) cstart = 0;
24598  }
24599  } else {
24600  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24601  goto bad;
24602  PyErr_Clear();
24603  }
24604  }
24605  return ms->sq_slice(obj, cstart, cstop);
24606  }
24607 #endif
24608  mp = Py_TYPE(obj)->tp_as_mapping;
24609  if (likely(mp && mp->mp_subscript))
24610 #endif
24611  {
24612  PyObject* result;
24613  PyObject *py_slice, *py_start, *py_stop;
24614  if (_py_slice) {
24615  py_slice = *_py_slice;
24616  } else {
24617  PyObject* owned_start = NULL;
24618  PyObject* owned_stop = NULL;
24619  if (_py_start) {
24620  py_start = *_py_start;
24621  } else {
24622  if (has_cstart) {
24623  owned_start = py_start = PyInt_FromSsize_t(cstart);
24624  if (unlikely(!py_start)) goto bad;
24625  } else
24626  py_start = Py_None;
24627  }
24628  if (_py_stop) {
24629  py_stop = *_py_stop;
24630  } else {
24631  if (has_cstop) {
24632  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
24633  if (unlikely(!py_stop)) {
24634  Py_XDECREF(owned_start);
24635  goto bad;
24636  }
24637  } else
24638  py_stop = Py_None;
24639  }
24640  py_slice = PySlice_New(py_start, py_stop, Py_None);
24641  Py_XDECREF(owned_start);
24642  Py_XDECREF(owned_stop);
24643  if (unlikely(!py_slice)) goto bad;
24644  }
24645 #if CYTHON_USE_TYPE_SLOTS
24646  result = mp->mp_subscript(obj, py_slice);
24647 #else
24648  result = PyObject_GetItem(obj, py_slice);
24649 #endif
24650  if (!_py_slice) {
24651  Py_DECREF(py_slice);
24652  }
24653  return result;
24654  }
24655  PyErr_Format(PyExc_TypeError,
24656  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
24657 bad:
24658  return NULL;
24659 }
24660 
24661 /* RaiseException */
24662  #if PY_MAJOR_VERSION < 3
24663 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24664  CYTHON_UNUSED PyObject *cause) {
24665  __Pyx_PyThreadState_declare
24666  Py_XINCREF(type);
24667  if (!value || value == Py_None)
24668  value = NULL;
24669  else
24670  Py_INCREF(value);
24671  if (!tb || tb == Py_None)
24672  tb = NULL;
24673  else {
24674  Py_INCREF(tb);
24675  if (!PyTraceBack_Check(tb)) {
24676  PyErr_SetString(PyExc_TypeError,
24677  "raise: arg 3 must be a traceback or None");
24678  goto raise_error;
24679  }
24680  }
24681  if (PyType_Check(type)) {
24682 #if CYTHON_COMPILING_IN_PYPY
24683  if (!value) {
24684  Py_INCREF(Py_None);
24685  value = Py_None;
24686  }
24687 #endif
24688  PyErr_NormalizeException(&type, &value, &tb);
24689  } else {
24690  if (value) {
24691  PyErr_SetString(PyExc_TypeError,
24692  "instance exception may not have a separate value");
24693  goto raise_error;
24694  }
24695  value = type;
24696  type = (PyObject*) Py_TYPE(type);
24697  Py_INCREF(type);
24698  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24699  PyErr_SetString(PyExc_TypeError,
24700  "raise: exception class must be a subclass of BaseException");
24701  goto raise_error;
24702  }
24703  }
24704  __Pyx_PyThreadState_assign
24705  __Pyx_ErrRestore(type, value, tb);
24706  return;
24707 raise_error:
24708  Py_XDECREF(value);
24709  Py_XDECREF(type);
24710  Py_XDECREF(tb);
24711  return;
24712 }
24713 #else
24714 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24715  PyObject* owned_instance = NULL;
24716  if (tb == Py_None) {
24717  tb = 0;
24718  } else if (tb && !PyTraceBack_Check(tb)) {
24719  PyErr_SetString(PyExc_TypeError,
24720  "raise: arg 3 must be a traceback or None");
24721  goto bad;
24722  }
24723  if (value == Py_None)
24724  value = 0;
24725  if (PyExceptionInstance_Check(type)) {
24726  if (value) {
24727  PyErr_SetString(PyExc_TypeError,
24728  "instance exception may not have a separate value");
24729  goto bad;
24730  }
24731  value = type;
24732  type = (PyObject*) Py_TYPE(value);
24733  } else if (PyExceptionClass_Check(type)) {
24734  PyObject *instance_class = NULL;
24735  if (value && PyExceptionInstance_Check(value)) {
24736  instance_class = (PyObject*) Py_TYPE(value);
24737  if (instance_class != type) {
24738  int is_subclass = PyObject_IsSubclass(instance_class, type);
24739  if (!is_subclass) {
24740  instance_class = NULL;
24741  } else if (unlikely(is_subclass == -1)) {
24742  goto bad;
24743  } else {
24744  type = instance_class;
24745  }
24746  }
24747  }
24748  if (!instance_class) {
24749  PyObject *args;
24750  if (!value)
24751  args = PyTuple_New(0);
24752  else if (PyTuple_Check(value)) {
24753  Py_INCREF(value);
24754  args = value;
24755  } else
24756  args = PyTuple_Pack(1, value);
24757  if (!args)
24758  goto bad;
24759  owned_instance = PyObject_Call(type, args, NULL);
24760  Py_DECREF(args);
24761  if (!owned_instance)
24762  goto bad;
24763  value = owned_instance;
24764  if (!PyExceptionInstance_Check(value)) {
24765  PyErr_Format(PyExc_TypeError,
24766  "calling %R should have returned an instance of "
24767  "BaseException, not %R",
24768  type, Py_TYPE(value));
24769  goto bad;
24770  }
24771  }
24772  } else {
24773  PyErr_SetString(PyExc_TypeError,
24774  "raise: exception class must be a subclass of BaseException");
24775  goto bad;
24776  }
24777  if (cause) {
24778  PyObject *fixed_cause;
24779  if (cause == Py_None) {
24780  fixed_cause = NULL;
24781  } else if (PyExceptionClass_Check(cause)) {
24782  fixed_cause = PyObject_CallObject(cause, NULL);
24783  if (fixed_cause == NULL)
24784  goto bad;
24785  } else if (PyExceptionInstance_Check(cause)) {
24786  fixed_cause = cause;
24787  Py_INCREF(fixed_cause);
24788  } else {
24789  PyErr_SetString(PyExc_TypeError,
24790  "exception causes must derive from "
24791  "BaseException");
24792  goto bad;
24793  }
24794  PyException_SetCause(value, fixed_cause);
24795  }
24796  PyErr_SetObject(type, value);
24797  if (tb) {
24798 #if CYTHON_COMPILING_IN_PYPY
24799  PyObject *tmp_type, *tmp_value, *tmp_tb;
24800  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24801  Py_INCREF(tb);
24802  PyErr_Restore(tmp_type, tmp_value, tb);
24803  Py_XDECREF(tmp_tb);
24804 #else
24805  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24806  PyObject* tmp_tb = tstate->curexc_traceback;
24807  if (tb != tmp_tb) {
24808  Py_INCREF(tb);
24809  tstate->curexc_traceback = tb;
24810  Py_XDECREF(tmp_tb);
24811  }
24812 #endif
24813  }
24814 bad:
24815  Py_XDECREF(owned_instance);
24816  return;
24817 }
24818 #endif
24819 
24820 /* WriteUnraisableException */
24821  static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24822  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24823  int full_traceback, CYTHON_UNUSED int nogil) {
24824  PyObject *old_exc, *old_val, *old_tb;
24825  PyObject *ctx;
24826  __Pyx_PyThreadState_declare
24827 #ifdef WITH_THREAD
24828  PyGILState_STATE state;
24829  if (nogil)
24830  state = PyGILState_Ensure();
24831 #ifdef _MSC_VER
24832  else state = (PyGILState_STATE)-1;
24833 #endif
24834 #endif
24835  __Pyx_PyThreadState_assign
24836  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24837  if (full_traceback) {
24838  Py_XINCREF(old_exc);
24839  Py_XINCREF(old_val);
24840  Py_XINCREF(old_tb);
24841  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24842  PyErr_PrintEx(1);
24843  }
24844  #if PY_MAJOR_VERSION < 3
24845  ctx = PyString_FromString(name);
24846  #else
24847  ctx = PyUnicode_FromString(name);
24848  #endif
24849  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24850  if (!ctx) {
24851  PyErr_WriteUnraisable(Py_None);
24852  } else {
24853  PyErr_WriteUnraisable(ctx);
24854  Py_DECREF(ctx);
24855  }
24856 #ifdef WITH_THREAD
24857  if (nogil)
24858  PyGILState_Release(state);
24859 #endif
24860 }
24861 
24862 /* DictGetItem */
24863  #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24864 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24865  PyObject *value;
24866  value = PyDict_GetItemWithError(d, key);
24867  if (unlikely(!value)) {
24868  if (!PyErr_Occurred()) {
24869  PyObject* args = PyTuple_Pack(1, key);
24870  if (likely(args))
24871  PyErr_SetObject(PyExc_KeyError, args);
24872  Py_XDECREF(args);
24873  }
24874  return NULL;
24875  }
24876  Py_INCREF(value);
24877  return value;
24878 }
24879 #endif
24880 
24881 /* RaiseTooManyValuesToUnpack */
24882  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24883  PyErr_Format(PyExc_ValueError,
24884  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24885 }
24886 
24887 /* RaiseNeedMoreValuesToUnpack */
24888  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24889  PyErr_Format(PyExc_ValueError,
24890  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24891  index, (index == 1) ? "" : "s");
24892 }
24893 
24894 /* RaiseNoneIterError */
24895  static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24896  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24897 }
24898 
24899 /* PyErrExceptionMatches */
24900  #if CYTHON_FAST_THREAD_STATE
24901 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24902  Py_ssize_t i, n;
24903  n = PyTuple_GET_SIZE(tuple);
24904 #if PY_MAJOR_VERSION >= 3
24905  for (i=0; i<n; i++) {
24906  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24907  }
24908 #endif
24909  for (i=0; i<n; i++) {
24910  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24911  }
24912  return 0;
24913 }
24914 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24915  PyObject *exc_type = tstate->curexc_type;
24916  if (exc_type == err) return 1;
24917  if (unlikely(!exc_type)) return 0;
24918  if (unlikely(PyTuple_Check(err)))
24919  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24920  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24921 }
24922 #endif
24923 
24924 /* ArgTypeTest */
24925  static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24926 {
24927  if (unlikely(!type)) {
24928  PyErr_SetString(PyExc_SystemError, "Missing type object");
24929  return 0;
24930  }
24931  else if (exact) {
24932  #if PY_MAJOR_VERSION == 2
24933  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24934  #endif
24935  }
24936  else {
24937  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24938  }
24939  PyErr_Format(PyExc_TypeError,
24940  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24941  name, type->tp_name, Py_TYPE(obj)->tp_name);
24942  return 0;
24943 }
24944 
24945 /* BytesEquals */
24946  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24947 #if CYTHON_COMPILING_IN_PYPY
24948  return PyObject_RichCompareBool(s1, s2, equals);
24949 #else
24950  if (s1 == s2) {
24951  return (equals == Py_EQ);
24952  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24953  const char *ps1, *ps2;
24954  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24955  if (length != PyBytes_GET_SIZE(s2))
24956  return (equals == Py_NE);
24957  ps1 = PyBytes_AS_STRING(s1);
24958  ps2 = PyBytes_AS_STRING(s2);
24959  if (ps1[0] != ps2[0]) {
24960  return (equals == Py_NE);
24961  } else if (length == 1) {
24962  return (equals == Py_EQ);
24963  } else {
24964  int result;
24965 #if CYTHON_USE_UNICODE_INTERNALS
24966  Py_hash_t hash1, hash2;
24967  hash1 = ((PyBytesObject*)s1)->ob_shash;
24968  hash2 = ((PyBytesObject*)s2)->ob_shash;
24969  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24970  return (equals == Py_NE);
24971  }
24972 #endif
24973  result = memcmp(ps1, ps2, (size_t)length);
24974  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24975  }
24976  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24977  return (equals == Py_NE);
24978  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24979  return (equals == Py_NE);
24980  } else {
24981  int result;
24982  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24983  if (!py_result)
24984  return -1;
24985  result = __Pyx_PyObject_IsTrue(py_result);
24986  Py_DECREF(py_result);
24987  return result;
24988  }
24989 #endif
24990 }
24991 
24992 /* UnicodeEquals */
24993  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
24994 #if CYTHON_COMPILING_IN_PYPY
24995  return PyObject_RichCompareBool(s1, s2, equals);
24996 #else
24997 #if PY_MAJOR_VERSION < 3
24998  PyObject* owned_ref = NULL;
24999 #endif
25000  int s1_is_unicode, s2_is_unicode;
25001  if (s1 == s2) {
25002  goto return_eq;
25003  }
25004  s1_is_unicode = PyUnicode_CheckExact(s1);
25005  s2_is_unicode = PyUnicode_CheckExact(s2);
25006 #if PY_MAJOR_VERSION < 3
25007  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25008  owned_ref = PyUnicode_FromObject(s2);
25009  if (unlikely(!owned_ref))
25010  return -1;
25011  s2 = owned_ref;
25012  s2_is_unicode = 1;
25013  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25014  owned_ref = PyUnicode_FromObject(s1);
25015  if (unlikely(!owned_ref))
25016  return -1;
25017  s1 = owned_ref;
25018  s1_is_unicode = 1;
25019  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25020  return __Pyx_PyBytes_Equals(s1, s2, equals);
25021  }
25022 #endif
25023  if (s1_is_unicode & s2_is_unicode) {
25024  Py_ssize_t length;
25025  int kind;
25026  void *data1, *data2;
25027  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25028  return -1;
25029  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25030  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25031  goto return_ne;
25032  }
25033 #if CYTHON_USE_UNICODE_INTERNALS
25034  {
25035  Py_hash_t hash1, hash2;
25036  #if CYTHON_PEP393_ENABLED
25037  hash1 = ((PyASCIIObject*)s1)->hash;
25038  hash2 = ((PyASCIIObject*)s2)->hash;
25039  #else
25040  hash1 = ((PyUnicodeObject*)s1)->hash;
25041  hash2 = ((PyUnicodeObject*)s2)->hash;
25042  #endif
25043  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25044  goto return_ne;
25045  }
25046  }
25047 #endif
25048  kind = __Pyx_PyUnicode_KIND(s1);
25049  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25050  goto return_ne;
25051  }
25052  data1 = __Pyx_PyUnicode_DATA(s1);
25053  data2 = __Pyx_PyUnicode_DATA(s2);
25054  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25055  goto return_ne;
25056  } else if (length == 1) {
25057  goto return_eq;
25058  } else {
25059  int result = memcmp(data1, data2, (size_t)(length * kind));
25060  #if PY_MAJOR_VERSION < 3
25061  Py_XDECREF(owned_ref);
25062  #endif
25063  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25064  }
25065  } else if ((s1 == Py_None) & s2_is_unicode) {
25066  goto return_ne;
25067  } else if ((s2 == Py_None) & s1_is_unicode) {
25068  goto return_ne;
25069  } else {
25070  int result;
25071  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25072  #if PY_MAJOR_VERSION < 3
25073  Py_XDECREF(owned_ref);
25074  #endif
25075  if (!py_result)
25076  return -1;
25077  result = __Pyx_PyObject_IsTrue(py_result);
25078  Py_DECREF(py_result);
25079  return result;
25080  }
25081 return_eq:
25082  #if PY_MAJOR_VERSION < 3
25083  Py_XDECREF(owned_ref);
25084  #endif
25085  return (equals == Py_EQ);
25086 return_ne:
25087  #if PY_MAJOR_VERSION < 3
25088  Py_XDECREF(owned_ref);
25089  #endif
25090  return (equals == Py_NE);
25091 #endif
25092 }
25093 
25094 /* None */
25095  static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25096  Py_ssize_t q = a / b;
25097  Py_ssize_t r = a - q*b;
25098  q -= ((r != 0) & ((r ^ b) < 0));
25099  return q;
25100 }
25101 
25102 /* GetAttr */
25103  static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25104 #if CYTHON_USE_TYPE_SLOTS
25105 #if PY_MAJOR_VERSION >= 3
25106  if (likely(PyUnicode_Check(n)))
25107 #else
25108  if (likely(PyString_Check(n)))
25109 #endif
25110  return __Pyx_PyObject_GetAttrStr(o, n);
25111 #endif
25112  return PyObject_GetAttr(o, n);
25113 }
25114 
25115 /* decode_c_string */
25116  static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25117  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25118  const char* encoding, const char* errors,
25119  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25120  Py_ssize_t length;
25121  if (unlikely((start < 0) | (stop < 0))) {
25122  size_t slen = strlen(cstring);
25123  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25124  PyErr_SetString(PyExc_OverflowError,
25125  "c-string too long to convert to Python");
25126  return NULL;
25127  }
25128  length = (Py_ssize_t) slen;
25129  if (start < 0) {
25130  start += length;
25131  if (start < 0)
25132  start = 0;
25133  }
25134  if (stop < 0)
25135  stop += length;
25136  }
25137  length = stop - start;
25138  if (unlikely(length <= 0))
25139  return PyUnicode_FromUnicode(NULL, 0);
25140  cstring += start;
25141  if (decode_func) {
25142  return decode_func(cstring, length, errors);
25143  } else {
25144  return PyUnicode_Decode(cstring, length, encoding, errors);
25145  }
25146 }
25147 
25148 /* GetAttr3 */
25149  static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25150  __Pyx_PyThreadState_declare
25151  __Pyx_PyThreadState_assign
25152  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25153  return NULL;
25154  __Pyx_PyErr_Clear();
25155  Py_INCREF(d);
25156  return d;
25157 }
25158 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25159  PyObject *r = __Pyx_GetAttr(o, n);
25160  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25161 }
25162 
25163 /* GetModuleGlobalName */
25164  static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
25165  PyObject *result;
25166 #if !CYTHON_AVOID_BORROWED_REFS
25167 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25168  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25169  if (likely(result)) {
25170  Py_INCREF(result);
25171  } else if (unlikely(PyErr_Occurred())) {
25172  result = NULL;
25173  } else {
25174 #else
25175  result = PyDict_GetItem(__pyx_d, name);
25176  if (likely(result)) {
25177  Py_INCREF(result);
25178  } else {
25179 #endif
25180 #else
25181  result = PyObject_GetItem(__pyx_d, name);
25182  if (!result) {
25183  PyErr_Clear();
25184 #endif
25185  result = __Pyx_GetBuiltinName(name);
25186  }
25187  return result;
25188 }
25189 
25190 /* SwapException */
25191  #if CYTHON_FAST_THREAD_STATE
25192 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25193  PyObject *tmp_type, *tmp_value, *tmp_tb;
25194  #if PY_VERSION_HEX >= 0x030700A3
25195  tmp_type = tstate->exc_state.exc_type;
25196  tmp_value = tstate->exc_state.exc_value;
25197  tmp_tb = tstate->exc_state.exc_traceback;
25198  tstate->exc_state.exc_type = *type;
25199  tstate->exc_state.exc_value = *value;
25200  tstate->exc_state.exc_traceback = *tb;
25201  #else
25202  tmp_type = tstate->exc_type;
25203  tmp_value = tstate->exc_value;
25204  tmp_tb = tstate->exc_traceback;
25205  tstate->exc_type = *type;
25206  tstate->exc_value = *value;
25207  tstate->exc_traceback = *tb;
25208  #endif
25209  *type = tmp_type;
25210  *value = tmp_value;
25211  *tb = tmp_tb;
25212 }
25213 #else
25214 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25215  PyObject *tmp_type, *tmp_value, *tmp_tb;
25216  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25217  PyErr_SetExcInfo(*type, *value, *tb);
25218  *type = tmp_type;
25219  *value = tmp_value;
25220  *tb = tmp_tb;
25221 }
25222 #endif
25223 
25224 /* Import */
25225  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25226  PyObject *empty_list = 0;
25227  PyObject *module = 0;
25228  PyObject *global_dict = 0;
25229  PyObject *empty_dict = 0;
25230  PyObject *list;
25231  #if PY_MAJOR_VERSION < 3
25232  PyObject *py_import;
25233  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25234  if (!py_import)
25235  goto bad;
25236  #endif
25237  if (from_list)
25238  list = from_list;
25239  else {
25240  empty_list = PyList_New(0);
25241  if (!empty_list)
25242  goto bad;
25243  list = empty_list;
25244  }
25245  global_dict = PyModule_GetDict(__pyx_m);
25246  if (!global_dict)
25247  goto bad;
25248  empty_dict = PyDict_New();
25249  if (!empty_dict)
25250  goto bad;
25251  {
25252  #if PY_MAJOR_VERSION >= 3
25253  if (level == -1) {
25254  if (strchr(__Pyx_MODULE_NAME, '.')) {
25255  module = PyImport_ImportModuleLevelObject(
25256  name, global_dict, empty_dict, list, 1);
25257  if (!module) {
25258  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25259  goto bad;
25260  PyErr_Clear();
25261  }
25262  }
25263  level = 0;
25264  }
25265  #endif
25266  if (!module) {
25267  #if PY_MAJOR_VERSION < 3
25268  PyObject *py_level = PyInt_FromLong(level);
25269  if (!py_level)
25270  goto bad;
25271  module = PyObject_CallFunctionObjArgs(py_import,
25272  name, global_dict, empty_dict, list, py_level, NULL);
25273  Py_DECREF(py_level);
25274  #else
25275  module = PyImport_ImportModuleLevelObject(
25276  name, global_dict, empty_dict, list, level);
25277  #endif
25278  }
25279  }
25280 bad:
25281  #if PY_MAJOR_VERSION < 3
25282  Py_XDECREF(py_import);
25283  #endif
25284  Py_XDECREF(empty_list);
25285  Py_XDECREF(empty_dict);
25286  return module;
25287 }
25288 
25289 /* FastTypeChecks */
25290  #if CYTHON_COMPILING_IN_CPYTHON
25291 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25292  while (a) {
25293  a = a->tp_base;
25294  if (a == b)
25295  return 1;
25296  }
25297  return b == &PyBaseObject_Type;
25298 }
25299 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25300  PyObject *mro;
25301  if (a == b) return 1;
25302  mro = a->tp_mro;
25303  if (likely(mro)) {
25304  Py_ssize_t i, n;
25305  n = PyTuple_GET_SIZE(mro);
25306  for (i = 0; i < n; i++) {
25307  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25308  return 1;
25309  }
25310  return 0;
25311  }
25312  return __Pyx_InBases(a, b);
25313 }
25314 #if PY_MAJOR_VERSION == 2
25315 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25316  PyObject *exception, *value, *tb;
25317  int res;
25318  __Pyx_PyThreadState_declare
25319  __Pyx_PyThreadState_assign
25320  __Pyx_ErrFetch(&exception, &value, &tb);
25321  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25322  if (unlikely(res == -1)) {
25323  PyErr_WriteUnraisable(err);
25324  res = 0;
25325  }
25326  if (!res) {
25327  res = PyObject_IsSubclass(err, exc_type2);
25328  if (unlikely(res == -1)) {
25329  PyErr_WriteUnraisable(err);
25330  res = 0;
25331  }
25332  }
25333  __Pyx_ErrRestore(exception, value, tb);
25334  return res;
25335 }
25336 #else
25337 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25338  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25339  if (!res) {
25340  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25341  }
25342  return res;
25343 }
25344 #endif
25345 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25346  Py_ssize_t i, n;
25347  assert(PyExceptionClass_Check(exc_type));
25348  n = PyTuple_GET_SIZE(tuple);
25349 #if PY_MAJOR_VERSION >= 3
25350  for (i=0; i<n; i++) {
25351  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25352  }
25353 #endif
25354  for (i=0; i<n; i++) {
25355  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25356  #if PY_MAJOR_VERSION < 3
25357  if (likely(exc_type == t)) return 1;
25358  #endif
25359  if (likely(PyExceptionClass_Check(t))) {
25360  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25361  } else {
25362  }
25363  }
25364  return 0;
25365 }
25366 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25367  if (likely(err == exc_type)) return 1;
25368  if (likely(PyExceptionClass_Check(err))) {
25369  if (likely(PyExceptionClass_Check(exc_type))) {
25370  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25371  } else if (likely(PyTuple_Check(exc_type))) {
25372  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25373  } else {
25374  }
25375  }
25376  return PyErr_GivenExceptionMatches(err, exc_type);
25377 }
25378 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25379  assert(PyExceptionClass_Check(exc_type1));
25380  assert(PyExceptionClass_Check(exc_type2));
25381  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25382  if (likely(PyExceptionClass_Check(err))) {
25383  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25384  }
25385  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25386 }
25387 #endif
25388 
25389 /* None */
25390  static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25391  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25392 }
25393 
25394 /* None */
25395  static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25396  long q = a / b;
25397  long r = a - q*b;
25398  q -= ((r != 0) & ((r ^ b) < 0));
25399  return q;
25400 }
25401 
25402 /* ImportFrom */
25403  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25404  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25405  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25406  PyErr_Format(PyExc_ImportError,
25407  #if PY_MAJOR_VERSION < 3
25408  "cannot import name %.230s", PyString_AS_STRING(name));
25409  #else
25410  "cannot import name %S", name);
25411  #endif
25412  }
25413  return value;
25414 }
25415 
25416 /* HasAttr */
25417  static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25418  PyObject *r;
25419  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25420  PyErr_SetString(PyExc_TypeError,
25421  "hasattr(): attribute name must be string");
25422  return -1;
25423  }
25424  r = __Pyx_GetAttr(o, n);
25425  if (unlikely(!r)) {
25426  PyErr_Clear();
25427  return 0;
25428  } else {
25429  Py_DECREF(r);
25430  return 1;
25431  }
25432 }
25433 
25434 /* PyObject_GenericGetAttrNoDict */
25435  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25436 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25437  PyErr_Format(PyExc_AttributeError,
25438 #if PY_MAJOR_VERSION >= 3
25439  "'%.50s' object has no attribute '%U'",
25440  tp->tp_name, attr_name);
25441 #else
25442  "'%.50s' object has no attribute '%.400s'",
25443  tp->tp_name, PyString_AS_STRING(attr_name));
25444 #endif
25445  return NULL;
25446 }
25447 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25448  PyObject *descr;
25449  PyTypeObject *tp = Py_TYPE(obj);
25450  if (unlikely(!PyString_Check(attr_name))) {
25451  return PyObject_GenericGetAttr(obj, attr_name);
25452  }
25453  assert(!tp->tp_dictoffset);
25454  descr = _PyType_Lookup(tp, attr_name);
25455  if (unlikely(!descr)) {
25456  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25457  }
25458  Py_INCREF(descr);
25459  #if PY_MAJOR_VERSION < 3
25460  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25461  #endif
25462  {
25463  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25464  if (unlikely(f)) {
25465  PyObject *res = f(descr, obj, (PyObject *)tp);
25466  Py_DECREF(descr);
25467  return res;
25468  }
25469  }
25470  return descr;
25471 }
25472 #endif
25473 
25474 /* PyObject_GenericGetAttr */
25475  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25476 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25477  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25478  return PyObject_GenericGetAttr(obj, attr_name);
25479  }
25480  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25481 }
25482 #endif
25483 
25484 /* SetupReduce */
25485  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25486  int ret;
25487  PyObject *name_attr;
25488  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25489  if (likely(name_attr)) {
25490  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25491  } else {
25492  ret = -1;
25493  }
25494  if (unlikely(ret < 0)) {
25495  PyErr_Clear();
25496  ret = 0;
25497  }
25498  Py_XDECREF(name_attr);
25499  return ret;
25500 }
25501 static int __Pyx_setup_reduce(PyObject* type_obj) {
25502  int ret = 0;
25503  PyObject *object_reduce = NULL;
25504  PyObject *object_reduce_ex = NULL;
25505  PyObject *reduce = NULL;
25506  PyObject *reduce_ex = NULL;
25507  PyObject *reduce_cython = NULL;
25508  PyObject *setstate = NULL;
25509  PyObject *setstate_cython = NULL;
25510 #if CYTHON_USE_PYTYPE_LOOKUP
25511  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
25512 #else
25513  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
25514 #endif
25515 #if CYTHON_USE_PYTYPE_LOOKUP
25516  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
25517 #else
25518  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
25519 #endif
25520  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
25521  if (reduce_ex == object_reduce_ex) {
25522 #if CYTHON_USE_PYTYPE_LOOKUP
25523  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
25524 #else
25525  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
25526 #endif
25527  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
25528  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25529  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
25530  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
25531  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
25532  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25533  if (!setstate) PyErr_Clear();
25534  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25535  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
25536  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
25537  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
25538  }
25539  PyType_Modified((PyTypeObject*)type_obj);
25540  }
25541  }
25542  goto GOOD;
25543 BAD:
25544  if (!PyErr_Occurred())
25545  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25546  ret = -1;
25547 GOOD:
25548 #if !CYTHON_USE_PYTYPE_LOOKUP
25549  Py_XDECREF(object_reduce);
25550  Py_XDECREF(object_reduce_ex);
25551 #endif
25552  Py_XDECREF(reduce);
25553  Py_XDECREF(reduce_ex);
25554  Py_XDECREF(reduce_cython);
25555  Py_XDECREF(setstate);
25556  Py_XDECREF(setstate_cython);
25557  return ret;
25558 }
25559 
25560 /* SetVTable */
25561  static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25562 #if PY_VERSION_HEX >= 0x02070000
25563  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25564 #else
25565  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25566 #endif
25567  if (!ob)
25568  goto bad;
25569  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25570  goto bad;
25571  Py_DECREF(ob);
25572  return 0;
25573 bad:
25574  Py_XDECREF(ob);
25575  return -1;
25576 }
25577 
25578 /* CalculateMetaclass */
25579  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
25580  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
25581  for (i=0; i < nbases; i++) {
25582  PyTypeObject *tmptype;
25583  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
25584  tmptype = Py_TYPE(tmp);
25585 #if PY_MAJOR_VERSION < 3
25586  if (tmptype == &PyClass_Type)
25587  continue;
25588 #endif
25589  if (!metaclass) {
25590  metaclass = tmptype;
25591  continue;
25592  }
25593  if (PyType_IsSubtype(metaclass, tmptype))
25594  continue;
25595  if (PyType_IsSubtype(tmptype, metaclass)) {
25596  metaclass = tmptype;
25597  continue;
25598  }
25599  PyErr_SetString(PyExc_TypeError,
25600  "metaclass conflict: "
25601  "the metaclass of a derived class "
25602  "must be a (non-strict) subclass "
25603  "of the metaclasses of all its bases");
25604  return NULL;
25605  }
25606  if (!metaclass) {
25607 #if PY_MAJOR_VERSION < 3
25608  metaclass = &PyClass_Type;
25609 #else
25610  metaclass = &PyType_Type;
25611 #endif
25612  }
25613  Py_INCREF((PyObject*) metaclass);
25614  return (PyObject*) metaclass;
25615 }
25616 
25617 /* FetchCommonType */
25618  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25619  PyObject* fake_module;
25620  PyTypeObject* cached_type = NULL;
25621  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25622  if (!fake_module) return NULL;
25623  Py_INCREF(fake_module);
25624  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25625  if (cached_type) {
25626  if (!PyType_Check((PyObject*)cached_type)) {
25627  PyErr_Format(PyExc_TypeError,
25628  "Shared Cython type %.200s is not a type object",
25629  type->tp_name);
25630  goto bad;
25631  }
25632  if (cached_type->tp_basicsize != type->tp_basicsize) {
25633  PyErr_Format(PyExc_TypeError,
25634  "Shared Cython type %.200s has the wrong size, try recompiling",
25635  type->tp_name);
25636  goto bad;
25637  }
25638  } else {
25639  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25640  PyErr_Clear();
25641  if (PyType_Ready(type) < 0) goto bad;
25642  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25643  goto bad;
25644  Py_INCREF(type);
25645  cached_type = type;
25646  }
25647 done:
25648  Py_DECREF(fake_module);
25649  return cached_type;
25650 bad:
25651  Py_XDECREF(cached_type);
25652  cached_type = NULL;
25653  goto done;
25654 }
25655 
25656 /* CythonFunction */
25657  #include <structmember.h>
25658 static PyObject *
25659 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25660 {
25661  if (unlikely(op->func_doc == NULL)) {
25662  if (op->func.m_ml->ml_doc) {
25663 #if PY_MAJOR_VERSION >= 3
25664  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25665 #else
25666  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25667 #endif
25668  if (unlikely(op->func_doc == NULL))
25669  return NULL;
25670  } else {
25671  Py_INCREF(Py_None);
25672  return Py_None;
25673  }
25674  }
25675  Py_INCREF(op->func_doc);
25676  return op->func_doc;
25677 }
25678 static int
25679 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
25680 {
25681  PyObject *tmp = op->func_doc;
25682  if (value == NULL) {
25683  value = Py_None;
25684  }
25685  Py_INCREF(value);
25686  op->func_doc = value;
25687  Py_XDECREF(tmp);
25688  return 0;
25689 }
25690 static PyObject *
25691 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
25692 {
25693  if (unlikely(op->func_name == NULL)) {
25694 #if PY_MAJOR_VERSION >= 3
25695  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25696 #else
25697  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25698 #endif
25699  if (unlikely(op->func_name == NULL))
25700  return NULL;
25701  }
25702  Py_INCREF(op->func_name);
25703  return op->func_name;
25704 }
25705 static int
25706 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
25707 {
25708  PyObject *tmp;
25709 #if PY_MAJOR_VERSION >= 3
25710  if (unlikely(value == NULL || !PyUnicode_Check(value))) {
25711 #else
25712  if (unlikely(value == NULL || !PyString_Check(value))) {
25713 #endif
25714  PyErr_SetString(PyExc_TypeError,
25715  "__name__ must be set to a string object");
25716  return -1;
25717  }
25718  tmp = op->func_name;
25719  Py_INCREF(value);
25720  op->func_name = value;
25721  Py_XDECREF(tmp);
25722  return 0;
25723 }
25724 static PyObject *
25725 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
25726 {
25727  Py_INCREF(op->func_qualname);
25728  return op->func_qualname;
25729 }
25730 static int
25731 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
25732 {
25733  PyObject *tmp;
25734 #if PY_MAJOR_VERSION >= 3
25735  if (unlikely(value == NULL || !PyUnicode_Check(value))) {
25736 #else
25737  if (unlikely(value == NULL || !PyString_Check(value))) {
25738 #endif
25739  PyErr_SetString(PyExc_TypeError,
25740  "__qualname__ must be set to a string object");
25741  return -1;
25742  }
25743  tmp = op->func_qualname;
25744  Py_INCREF(value);
25745  op->func_qualname = value;
25746  Py_XDECREF(tmp);
25747  return 0;
25748 }
25749 static PyObject *
25750 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25751 {
25752  PyObject *self;
25753  self = m->func_closure;
25754  if (self == NULL)
25755  self = Py_None;
25756  Py_INCREF(self);
25757  return self;
25758 }
25759 static PyObject *
25760 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
25761 {
25762  if (unlikely(op->func_dict == NULL)) {
25763  op->func_dict = PyDict_New();
25764  if (unlikely(op->func_dict == NULL))
25765  return NULL;
25766  }
25767  Py_INCREF(op->func_dict);
25768  return op->func_dict;
25769 }
25770 static int
25771 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
25772 {
25773  PyObject *tmp;
25774  if (unlikely(value == NULL)) {
25775  PyErr_SetString(PyExc_TypeError,
25776  "function's dictionary may not be deleted");
25777  return -1;
25778  }
25779  if (unlikely(!PyDict_Check(value))) {
25780  PyErr_SetString(PyExc_TypeError,
25781  "setting function's dictionary to a non-dict");
25782  return -1;
25783  }
25784  tmp = op->func_dict;
25785  Py_INCREF(value);
25786  op->func_dict = value;
25787  Py_XDECREF(tmp);
25788  return 0;
25789 }
25790 static PyObject *
25791 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
25792 {
25793  Py_INCREF(op->func_globals);
25794  return op->func_globals;
25795 }
25796 static PyObject *
25797 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
25798 {
25799  Py_INCREF(Py_None);
25800  return Py_None;
25801 }
25802 static PyObject *
25803 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
25804 {
25805  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25806  Py_INCREF(result);
25807  return result;
25808 }
25809 static int
25810 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25811  int result = 0;
25812  PyObject *res = op->defaults_getter((PyObject *) op);
25813  if (unlikely(!res))
25814  return -1;
25815  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25816  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25817  Py_INCREF(op->defaults_tuple);
25818  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25819  Py_INCREF(op->defaults_kwdict);
25820  #else
25821  op->defaults_tuple = PySequence_ITEM(res, 0);
25822  if (unlikely(!op->defaults_tuple)) result = -1;
25823  else {
25824  op->defaults_kwdict = PySequence_ITEM(res, 1);
25825  if (unlikely(!op->defaults_kwdict)) result = -1;
25826  }
25827  #endif
25828  Py_DECREF(res);
25829  return result;
25830 }
25831 static int
25832 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
25833  PyObject* tmp;
25834  if (!value) {
25835  value = Py_None;
25836  } else if (value != Py_None && !PyTuple_Check(value)) {
25837  PyErr_SetString(PyExc_TypeError,
25838  "__defaults__ must be set to a tuple object");
25839  return -1;
25840  }
25841  Py_INCREF(value);
25842  tmp = op->defaults_tuple;
25843  op->defaults_tuple = value;
25844  Py_XDECREF(tmp);
25845  return 0;
25846 }
25847 static PyObject *
25848 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
25849  PyObject* result = op->defaults_tuple;
25850  if (unlikely(!result)) {
25851  if (op->defaults_getter) {
25852  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25853  result = op->defaults_tuple;
25854  } else {
25855  result = Py_None;
25856  }
25857  }
25858  Py_INCREF(result);
25859  return result;
25860 }
25861 static int
25862 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
25863  PyObject* tmp;
25864  if (!value) {
25865  value = Py_None;
25866  } else if (value != Py_None && !PyDict_Check(value)) {
25867  PyErr_SetString(PyExc_TypeError,
25868  "__kwdefaults__ must be set to a dict object");
25869  return -1;
25870  }
25871  Py_INCREF(value);
25872  tmp = op->defaults_kwdict;
25873  op->defaults_kwdict = value;
25874  Py_XDECREF(tmp);
25875  return 0;
25876 }
25877 static PyObject *
25878 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
25879  PyObject* result = op->defaults_kwdict;
25880  if (unlikely(!result)) {
25881  if (op->defaults_getter) {
25882  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25883  result = op->defaults_kwdict;
25884  } else {
25885  result = Py_None;
25886  }
25887  }
25888  Py_INCREF(result);
25889  return result;
25890 }
25891 static int
25892 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
25893  PyObject* tmp;
25894  if (!value || value == Py_None) {
25895  value = NULL;
25896  } else if (!PyDict_Check(value)) {
25897  PyErr_SetString(PyExc_TypeError,
25898  "__annotations__ must be set to a dict object");
25899  return -1;
25900  }
25901  Py_XINCREF(value);
25902  tmp = op->func_annotations;
25903  op->func_annotations = value;
25904  Py_XDECREF(tmp);
25905  return 0;
25906 }
25907 static PyObject *
25908 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
25909  PyObject* result = op->func_annotations;
25910  if (unlikely(!result)) {
25911  result = PyDict_New();
25912  if (unlikely(!result)) return NULL;
25913  op->func_annotations = result;
25914  }
25915  Py_INCREF(result);
25916  return result;
25917 }
25918 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25919  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25920  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25921  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25922  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25923  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25924  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25925  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25926  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25927  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25928  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25929  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25930  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25931  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25932  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25933  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25934  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25935  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25936  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25937  {0, 0, 0, 0, 0}
25938 };
25939 static PyMemberDef __pyx_CyFunction_members[] = {
25940  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25941  {0, 0, 0, 0, 0}
25942 };
25943 static PyObject *
25944 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25945 {
25946 #if PY_MAJOR_VERSION >= 3
25947  return PyUnicode_FromString(m->func.m_ml->ml_name);
25948 #else
25949  return PyString_FromString(m->func.m_ml->ml_name);
25950 #endif
25951 }
25952 static PyMethodDef __pyx_CyFunction_methods[] = {
25953  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25954  {0, 0, 0, 0}
25955 };
25956 #if PY_VERSION_HEX < 0x030500A0
25957 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25958 #else
25959 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25960 #endif
25961 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
25962  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25963  __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
25964  if (op == NULL)
25965  return NULL;
25966  op->flags = flags;
25967  __Pyx_CyFunction_weakreflist(op) = NULL;
25968  op->func.m_ml = ml;
25969  op->func.m_self = (PyObject *) op;
25970  Py_XINCREF(closure);
25971  op->func_closure = closure;
25972  Py_XINCREF(module);
25973  op->func.m_module = module;
25974  op->func_dict = NULL;
25975  op->func_name = NULL;
25976  Py_INCREF(qualname);
25977  op->func_qualname = qualname;
25978  op->func_doc = NULL;
25979  op->func_classobj = NULL;
25980  op->func_globals = globals;
25981  Py_INCREF(op->func_globals);
25982  Py_XINCREF(code);
25983  op->func_code = code;
25984  op->defaults_pyobjects = 0;
25985  op->defaults = NULL;
25986  op->defaults_tuple = NULL;
25987  op->defaults_kwdict = NULL;
25988  op->defaults_getter = NULL;
25989  op->func_annotations = NULL;
25990  PyObject_GC_Track(op);
25991  return (PyObject *) op;
25992 }
25993 static int
25994 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25995 {
25996  Py_CLEAR(m->func_closure);
25997  Py_CLEAR(m->func.m_module);
25998  Py_CLEAR(m->func_dict);
25999  Py_CLEAR(m->func_name);
26000  Py_CLEAR(m->func_qualname);
26001  Py_CLEAR(m->func_doc);
26002  Py_CLEAR(m->func_globals);
26003  Py_CLEAR(m->func_code);
26004  Py_CLEAR(m->func_classobj);
26005  Py_CLEAR(m->defaults_tuple);
26006  Py_CLEAR(m->defaults_kwdict);
26007  Py_CLEAR(m->func_annotations);
26008  if (m->defaults) {
26009  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26010  int i;
26011  for (i = 0; i < m->defaults_pyobjects; i++)
26012  Py_XDECREF(pydefaults[i]);
26013  PyObject_Free(m->defaults);
26014  m->defaults = NULL;
26015  }
26016  return 0;
26017 }
26018 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26019 {
26020  if (__Pyx_CyFunction_weakreflist(m) != NULL)
26021  PyObject_ClearWeakRefs((PyObject *) m);
26022  __Pyx_CyFunction_clear(m);
26023  PyObject_GC_Del(m);
26024 }
26025 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26026 {
26027  PyObject_GC_UnTrack(m);
26028  __Pyx__CyFunction_dealloc(m);
26029 }
26030 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
26031 {
26032  Py_VISIT(m->func_closure);
26033  Py_VISIT(m->func.m_module);
26034  Py_VISIT(m->func_dict);
26035  Py_VISIT(m->func_name);
26036  Py_VISIT(m->func_qualname);
26037  Py_VISIT(m->func_doc);
26038  Py_VISIT(m->func_globals);
26039  Py_VISIT(m->func_code);
26040  Py_VISIT(m->func_classobj);
26041  Py_VISIT(m->defaults_tuple);
26042  Py_VISIT(m->defaults_kwdict);
26043  if (m->defaults) {
26044  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26045  int i;
26046  for (i = 0; i < m->defaults_pyobjects; i++)
26047  Py_VISIT(pydefaults[i]);
26048  }
26049  return 0;
26050 }
26051 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26052 {
26053  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26054  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26055  Py_INCREF(func);
26056  return func;
26057  }
26058  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26059  if (type == NULL)
26060  type = (PyObject *)(Py_TYPE(obj));
26061  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26062  }
26063  if (obj == Py_None)
26064  obj = NULL;
26065  return __Pyx_PyMethod_New(func, obj, type);
26066 }
26067 static PyObject*
26068 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26069 {
26070 #if PY_MAJOR_VERSION >= 3
26071  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26072  op->func_qualname, (void *)op);
26073 #else
26074  return PyString_FromFormat("<cyfunction %s at %p>",
26075  PyString_AsString(op->func_qualname), (void *)op);
26076 #endif
26077 }
26078 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26079  PyCFunctionObject* f = (PyCFunctionObject*)func;
26080  PyCFunction meth = f->m_ml->ml_meth;
26081  Py_ssize_t size;
26082  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26083  case METH_VARARGS:
26084  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26085  return (*meth)(self, arg);
26086  break;
26087  case METH_VARARGS | METH_KEYWORDS:
26088  return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
26089  case METH_NOARGS:
26090  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26091  size = PyTuple_GET_SIZE(arg);
26092  if (likely(size == 0))
26093  return (*meth)(self, NULL);
26094  PyErr_Format(PyExc_TypeError,
26095  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26096  f->m_ml->ml_name, size);
26097  return NULL;
26098  }
26099  break;
26100  case METH_O:
26101  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26102  size = PyTuple_GET_SIZE(arg);
26103  if (likely(size == 1)) {
26104  PyObject *result, *arg0;
26105  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26106  arg0 = PyTuple_GET_ITEM(arg, 0);
26107  #else
26108  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26109  #endif
26110  result = (*meth)(self, arg0);
26111  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26112  Py_DECREF(arg0);
26113  #endif
26114  return result;
26115  }
26116  PyErr_Format(PyExc_TypeError,
26117  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26118  f->m_ml->ml_name, size);
26119  return NULL;
26120  }
26121  break;
26122  default:
26123  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26124  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26125  "longer supported!");
26126  return NULL;
26127  }
26128  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26129  f->m_ml->ml_name);
26130  return NULL;
26131 }
26132 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26133  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26134 }
26135 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26136  PyObject *result;
26137  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26138  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26139  Py_ssize_t argc;
26140  PyObject *new_args;
26141  PyObject *self;
26142  argc = PyTuple_GET_SIZE(args);
26143  new_args = PyTuple_GetSlice(args, 1, argc);
26144  if (unlikely(!new_args))
26145  return NULL;
26146  self = PyTuple_GetItem(args, 0);
26147  if (unlikely(!self)) {
26148  Py_DECREF(new_args);
26149  return NULL;
26150  }
26151  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26152  Py_DECREF(new_args);
26153  } else {
26154  result = __Pyx_CyFunction_Call(func, args, kw);
26155  }
26156  return result;
26157 }
26158 static PyTypeObject __pyx_CyFunctionType_type = {
26159  PyVarObject_HEAD_INIT(0, 0)
26160  "cython_function_or_method",
26161  sizeof(__pyx_CyFunctionObject),
26162  0,
26163  (destructor) __Pyx_CyFunction_dealloc,
26164  0,
26165  0,
26166  0,
26167 #if PY_MAJOR_VERSION < 3
26168  0,
26169 #else
26170  0,
26171 #endif
26172  (reprfunc) __Pyx_CyFunction_repr,
26173  0,
26174  0,
26175  0,
26176  0,
26177  __Pyx_CyFunction_CallAsMethod,
26178  0,
26179  0,
26180  0,
26181  0,
26182  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26183  0,
26184  (traverseproc) __Pyx_CyFunction_traverse,
26185  (inquiry) __Pyx_CyFunction_clear,
26186  0,
26187 #if PY_VERSION_HEX < 0x030500A0
26188  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26189 #else
26190  offsetof(PyCFunctionObject, m_weakreflist),
26191 #endif
26192  0,
26193  0,
26194  __pyx_CyFunction_methods,
26195  __pyx_CyFunction_members,
26196  __pyx_CyFunction_getsets,
26197  0,
26198  0,
26199  __Pyx_CyFunction_descr_get,
26200  0,
26201  offsetof(__pyx_CyFunctionObject, func_dict),
26202  0,
26203  0,
26204  0,
26205  0,
26206  0,
26207  0,
26208  0,
26209  0,
26210  0,
26211  0,
26212  0,
26213  0,
26214 #if PY_VERSION_HEX >= 0x030400a1
26215  0,
26216 #endif
26217 };
26218 static int __pyx_CyFunction_init(void) {
26219  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26220  if (unlikely(__pyx_CyFunctionType == NULL)) {
26221  return -1;
26222  }
26223  return 0;
26224 }
26225 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26226  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26227  m->defaults = PyObject_Malloc(size);
26228  if (unlikely(!m->defaults))
26229  return PyErr_NoMemory();
26230  memset(m->defaults, 0, size);
26231  m->defaults_pyobjects = pyobjects;
26232  return m->defaults;
26233 }
26234 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26235  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26236  m->defaults_tuple = tuple;
26237  Py_INCREF(tuple);
26238 }
26239 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26240  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26241  m->defaults_kwdict = dict;
26242  Py_INCREF(dict);
26243 }
26244 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26245  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26246  m->func_annotations = dict;
26247  Py_INCREF(dict);
26248 }
26249 
26250 /* Py3ClassCreate */
26251  static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
26252  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
26253  PyObject *ns;
26254  if (metaclass) {
26255  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
26256  if (prep) {
26257  PyObject *pargs = PyTuple_Pack(2, name, bases);
26258  if (unlikely(!pargs)) {
26259  Py_DECREF(prep);
26260  return NULL;
26261  }
26262  ns = PyObject_Call(prep, pargs, mkw);
26263  Py_DECREF(prep);
26264  Py_DECREF(pargs);
26265  } else {
26266  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
26267  return NULL;
26268  PyErr_Clear();
26269  ns = PyDict_New();
26270  }
26271  } else {
26272  ns = PyDict_New();
26273  }
26274  if (unlikely(!ns))
26275  return NULL;
26276  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
26277  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
26278  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
26279  return ns;
26280 bad:
26281  Py_DECREF(ns);
26282  return NULL;
26283 }
26284 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
26285  PyObject *dict, PyObject *mkw,
26286  int calculate_metaclass, int allow_py2_metaclass) {
26287  PyObject *result, *margs;
26288  PyObject *owned_metaclass = NULL;
26289  if (allow_py2_metaclass) {
26290  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
26291  if (owned_metaclass) {
26292  metaclass = owned_metaclass;
26293  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
26294  PyErr_Clear();
26295  } else {
26296  return NULL;
26297  }
26298  }
26299  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
26300  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
26301  Py_XDECREF(owned_metaclass);
26302  if (unlikely(!metaclass))
26303  return NULL;
26304  owned_metaclass = metaclass;
26305  }
26306  margs = PyTuple_Pack(3, name, bases, dict);
26307  if (unlikely(!margs)) {
26308  result = NULL;
26309  } else {
26310  result = PyObject_Call(metaclass, margs, mkw);
26311  Py_DECREF(margs);
26312  }
26313  Py_XDECREF(owned_metaclass);
26314  return result;
26315 }
26316 
26317 /* CLineInTraceback */
26318  #ifndef CYTHON_CLINE_IN_TRACEBACK
26319 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
26320  PyObject *use_cline;
26321  PyObject *ptype, *pvalue, *ptraceback;
26322 #if CYTHON_COMPILING_IN_CPYTHON
26323  PyObject **cython_runtime_dict;
26324 #endif
26325  if (unlikely(!__pyx_cython_runtime)) {
26326  return c_line;
26327  }
26328  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26329 #if CYTHON_COMPILING_IN_CPYTHON
26330  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26331  if (likely(cython_runtime_dict)) {
26332  use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
26333  } else
26334 #endif
26335  {
26336  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26337  if (use_cline_obj) {
26338  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26339  Py_DECREF(use_cline_obj);
26340  } else {
26341  PyErr_Clear();
26342  use_cline = NULL;
26343  }
26344  }
26345  if (!use_cline) {
26346  c_line = 0;
26347  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26348  }
26349  else if (PyObject_Not(use_cline) != 0) {
26350  c_line = 0;
26351  }
26352  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26353  return c_line;
26354 }
26355 #endif
26356 
26357 /* CodeObjectCache */
26358  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26359  int start = 0, mid = 0, end = count - 1;
26360  if (end >= 0 && code_line > entries[end].code_line) {
26361  return count;
26362  }
26363  while (start < end) {
26364  mid = start + (end - start) / 2;
26365  if (code_line < entries[mid].code_line) {
26366  end = mid;
26367  } else if (code_line > entries[mid].code_line) {
26368  start = mid + 1;
26369  } else {
26370  return mid;
26371  }
26372  }
26373  if (code_line <= entries[mid].code_line) {
26374  return mid;
26375  } else {
26376  return mid + 1;
26377  }
26378 }
26379 static PyCodeObject *__pyx_find_code_object(int code_line) {
26380  PyCodeObject* code_object;
26381  int pos;
26382  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26383  return NULL;
26384  }
26385  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26386  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26387  return NULL;
26388  }
26389  code_object = __pyx_code_cache.entries[pos].code_object;
26390  Py_INCREF(code_object);
26391  return code_object;
26392 }
26393 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26394  int pos, i;
26395  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26396  if (unlikely(!code_line)) {
26397  return;
26398  }
26399  if (unlikely(!entries)) {
26400  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26401  if (likely(entries)) {
26402  __pyx_code_cache.entries = entries;
26403  __pyx_code_cache.max_count = 64;
26404  __pyx_code_cache.count = 1;
26405  entries[0].code_line = code_line;
26406  entries[0].code_object = code_object;
26407  Py_INCREF(code_object);
26408  }
26409  return;
26410  }
26411  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26412  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26413  PyCodeObject* tmp = entries[pos].code_object;
26414  entries[pos].code_object = code_object;
26415  Py_DECREF(tmp);
26416  return;
26417  }
26418  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26419  int new_max = __pyx_code_cache.max_count + 64;
26420  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26421  __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
26422  if (unlikely(!entries)) {
26423  return;
26424  }
26425  __pyx_code_cache.entries = entries;
26426  __pyx_code_cache.max_count = new_max;
26427  }
26428  for (i=__pyx_code_cache.count; i>pos; i--) {
26429  entries[i] = entries[i-1];
26430  }
26431  entries[pos].code_line = code_line;
26432  entries[pos].code_object = code_object;
26433  __pyx_code_cache.count++;
26434  Py_INCREF(code_object);
26435 }
26436 
26437 /* AddTraceback */
26438  #include "compile.h"
26439 #include "frameobject.h"
26440 #include "traceback.h"
26441 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26442  const char *funcname, int c_line,
26443  int py_line, const char *filename) {
26444  PyCodeObject *py_code = 0;
26445  PyObject *py_srcfile = 0;
26446  PyObject *py_funcname = 0;
26447  #if PY_MAJOR_VERSION < 3
26448  py_srcfile = PyString_FromString(filename);
26449  #else
26450  py_srcfile = PyUnicode_FromString(filename);
26451  #endif
26452  if (!py_srcfile) goto bad;
26453  if (c_line) {
26454  #if PY_MAJOR_VERSION < 3
26455  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26456  #else
26457  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26458  #endif
26459  }
26460  else {
26461  #if PY_MAJOR_VERSION < 3
26462  py_funcname = PyString_FromString(funcname);
26463  #else
26464  py_funcname = PyUnicode_FromString(funcname);
26465  #endif
26466  }
26467  if (!py_funcname) goto bad;
26468  py_code = __Pyx_PyCode_New(
26469  0,
26470  0,
26471  0,
26472  0,
26473  0,
26474  __pyx_empty_bytes, /*PyObject *code,*/
26475  __pyx_empty_tuple, /*PyObject *consts,*/
26476  __pyx_empty_tuple, /*PyObject *names,*/
26477  __pyx_empty_tuple, /*PyObject *varnames,*/
26478  __pyx_empty_tuple, /*PyObject *freevars,*/
26479  __pyx_empty_tuple, /*PyObject *cellvars,*/
26480  py_srcfile, /*PyObject *filename,*/
26481  py_funcname, /*PyObject *name,*/
26482  py_line,
26483  __pyx_empty_bytes /*PyObject *lnotab*/
26484  );
26485  Py_DECREF(py_srcfile);
26486  Py_DECREF(py_funcname);
26487  return py_code;
26488 bad:
26489  Py_XDECREF(py_srcfile);
26490  Py_XDECREF(py_funcname);
26491  return NULL;
26492 }
26493 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26494  int py_line, const char *filename) {
26495  PyCodeObject *py_code = 0;
26496  PyFrameObject *py_frame = 0;
26497  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26498  if (c_line) {
26499  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26500  }
26501  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26502  if (!py_code) {
26503  py_code = __Pyx_CreateCodeObjectForTraceback(
26504  funcname, c_line, py_line, filename);
26505  if (!py_code) goto bad;
26506  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26507  }
26508  py_frame = PyFrame_New(
26509  tstate, /*PyThreadState *tstate,*/
26510  py_code, /*PyCodeObject *code,*/
26511  __pyx_d, /*PyObject *globals,*/
26512  0 /*PyObject *locals*/
26513  );
26514  if (!py_frame) goto bad;
26515  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26516  PyTraceBack_Here(py_frame);
26517 bad:
26518  Py_XDECREF(py_code);
26519  Py_XDECREF(py_frame);
26520 }
26521 
26522 #if PY_MAJOR_VERSION < 3
26523 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26524  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26525  if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26526  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26527  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26528  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26529  return -1;
26530 }
26531 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26532  PyObject *obj = view->obj;
26533  if (!obj) return;
26534  if (PyObject_CheckBuffer(obj)) {
26535  PyBuffer_Release(view);
26536  return;
26537  }
26538  if ((0)) {}
26539  else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
26540  view->obj = NULL;
26541  Py_DECREF(obj);
26542 }
26543 #endif
26544 
26545 
26546  /* MemviewSliceIsContig */
26547  static int
26548 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26549 {
26550  int i, index, step, start;
26551  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26552  if (order == 'F') {
26553  step = 1;
26554  start = 0;
26555  } else {
26556  step = -1;
26557  start = ndim - 1;
26558  }
26559  for (i = 0; i < ndim; i++) {
26560  index = start + step * i;
26561  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26562  return 0;
26563  itemsize *= mvs.shape[index];
26564  }
26565  return 1;
26566 }
26567 
26568 /* OverlappingSlices */
26569  static void
26570 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26571  void **out_start, void **out_end,
26572  int ndim, size_t itemsize)
26573 {
26574  char *start, *end;
26575  int i;
26576  start = end = slice->data;
26577  for (i = 0; i < ndim; i++) {
26578  Py_ssize_t stride = slice->strides[i];
26579  Py_ssize_t extent = slice->shape[i];
26580  if (extent == 0) {
26581  *out_start = *out_end = start;
26582  return;
26583  } else {
26584  if (stride > 0)
26585  end += stride * (extent - 1);
26586  else
26587  start += stride * (extent - 1);
26588  }
26589  }
26590  *out_start = start;
26591  *out_end = end + itemsize;
26592 }
26593 static int
26594 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26595  __Pyx_memviewslice *slice2,
26596  int ndim, size_t itemsize)
26597 {
26598  void *start1, *end1, *start2, *end2;
26599  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26600  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26601  return (start1 < end2) && (start2 < end1);
26602 }
26603 
26604 /* Capsule */
26605  static CYTHON_INLINE PyObject *
26606 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26607 {
26608  PyObject *cobj;
26609 #if PY_VERSION_HEX >= 0x02070000
26610  cobj = PyCapsule_New(p, sig, NULL);
26611 #else
26612  cobj = PyCObject_FromVoidPtr(p, NULL);
26613 #endif
26614  return cobj;
26615 }
26616 
26617 /* CIntFromPyVerify */
26618  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26619  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26620 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26621  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26622 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26623  {\
26624  func_type value = func_value;\
26625  if (sizeof(target_type) < sizeof(func_type)) {\
26626  if (unlikely(value != (func_type) (target_type) value)) {\
26627  func_type zero = 0;\
26628  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26629  return (target_type) -1;\
26630  if (is_unsigned && unlikely(value < zero))\
26631  goto raise_neg_overflow;\
26632  else\
26633  goto raise_overflow;\
26634  }\
26635  }\
26636  return (target_type) value;\
26637  }
26638 
26639 /* IsLittleEndian */
26640  static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
26641 {
26642  union {
26643  uint32_t u32;
26644  uint8_t u8[4];
26645  } S;
26646  S.u32 = 0x01020304;
26647  return S.u8[0] == 4;
26648 }
26649 
26650 /* BufferFormatCheck */
26651  static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26652  __Pyx_BufFmt_StackElem* stack,
26653  __Pyx_TypeInfo* type) {
26654  stack[0].field = &ctx->root;
26655  stack[0].parent_offset = 0;
26656  ctx->root.type = type;
26657  ctx->root.name = "buffer dtype";
26658  ctx->root.offset = 0;
26659  ctx->head = stack;
26660  ctx->head->field = &ctx->root;
26661  ctx->fmt_offset = 0;
26662  ctx->head->parent_offset = 0;
26663  ctx->new_packmode = '@';
26664  ctx->enc_packmode = '@';
26665  ctx->new_count = 1;
26666  ctx->enc_count = 0;
26667  ctx->enc_type = 0;
26668  ctx->is_complex = 0;
26669  ctx->is_valid_array = 0;
26670  ctx->struct_alignment = 0;
26671  while (type->typegroup == 'S') {
26672  ++ctx->head;
26673  ctx->head->field = type->fields;
26674  ctx->head->parent_offset = 0;
26675  type = type->fields->type;
26676  }
26677 }
26678 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
26679  int count;
26680  const char* t = *ts;
26681  if (*t < '0' || *t > '9') {
26682  return -1;
26683  } else {
26684  count = *t++ - '0';
26685  while (*t >= '0' && *t < '9') {
26686  count *= 10;
26687  count += *t++ - '0';
26688  }
26689  }
26690  *ts = t;
26691  return count;
26692 }
26693 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
26694  int number = __Pyx_BufFmt_ParseNumber(ts);
26695  if (number == -1)
26696  PyErr_Format(PyExc_ValueError,\
26697  "Does not understand character buffer dtype format string ('%c')", **ts);
26698  return number;
26699 }
26700 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
26701  PyErr_Format(PyExc_ValueError,
26702  "Unexpected format string character: '%c'", ch);
26703 }
26704 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
26705  switch (ch) {
26706  case 'c': return "'char'";
26707  case 'b': return "'signed char'";
26708  case 'B': return "'unsigned char'";
26709  case 'h': return "'short'";
26710  case 'H': return "'unsigned short'";
26711  case 'i': return "'int'";
26712  case 'I': return "'unsigned int'";
26713  case 'l': return "'long'";
26714  case 'L': return "'unsigned long'";
26715  case 'q': return "'long long'";
26716  case 'Q': return "'unsigned long long'";
26717  case 'f': return (is_complex ? "'complex float'" : "'float'");
26718  case 'd': return (is_complex ? "'complex double'" : "'double'");
26719  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
26720  case 'T': return "a struct";
26721  case 'O': return "Python object";
26722  case 'P': return "a pointer";
26723  case 's': case 'p': return "a string";
26724  case 0: return "end";
26725  default: return "unparseable format string";
26726  }
26727 }
26728 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
26729  switch (ch) {
26730  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26731  case 'h': case 'H': return 2;
26732  case 'i': case 'I': case 'l': case 'L': return 4;
26733  case 'q': case 'Q': return 8;
26734  case 'f': return (is_complex ? 8 : 4);
26735  case 'd': return (is_complex ? 16 : 8);
26736  case 'g': {
26737  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
26738  return 0;
26739  }
26740  case 'O': case 'P': return sizeof(void*);
26741  default:
26742  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26743  return 0;
26744  }
26745 }
26746 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
26747  switch (ch) {
26748  case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26749  case 'h': case 'H': return sizeof(short);
26750  case 'i': case 'I': return sizeof(int);
26751  case 'l': case 'L': return sizeof(long);
26752  #ifdef HAVE_LONG_LONG
26753  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
26754  #endif
26755  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
26756  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
26757  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
26758  case 'O': case 'P': return sizeof(void*);
26759  default: {
26760  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26761  return 0;
26762  }
26763  }
26764 }
26765 typedef struct { char c; short x; } __Pyx_st_short;
26766 typedef struct { char c; int x; } __Pyx_st_int;
26767 typedef struct { char c; long x; } __Pyx_st_long;
26768 typedef struct { char c; float x; } __Pyx_st_float;
26769 typedef struct { char c; double x; } __Pyx_st_double;
26770 typedef struct { char c; long double x; } __Pyx_st_longdouble;
26771 typedef struct { char c; void *x; } __Pyx_st_void_p;
26772 #ifdef HAVE_LONG_LONG
26773 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26774 #endif
26775 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
26776  switch (ch) {
26777  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26778  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
26779  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
26780  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
26781 #ifdef HAVE_LONG_LONG
26782  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
26783 #endif
26784  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
26785  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
26786  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
26787  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
26788  default:
26789  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26790  return 0;
26791  }
26792 }
26793 /* These are for computing the padding at the end of the struct to align
26794  on the first member of the struct. This will probably the same as above,
26795  but we don't have any guarantees.
26796  */
26797 typedef struct { short x; char c; } __Pyx_pad_short;
26798 typedef struct { int x; char c; } __Pyx_pad_int;
26799 typedef struct { long x; char c; } __Pyx_pad_long;
26800 typedef struct { float x; char c; } __Pyx_pad_float;
26801 typedef struct { double x; char c; } __Pyx_pad_double;
26802 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
26803 typedef struct { void *x; char c; } __Pyx_pad_void_p;
26804 #ifdef HAVE_LONG_LONG
26805 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
26806 #endif
26807 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
26808  switch (ch) {
26809  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26810  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
26811  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
26812  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
26813 #ifdef HAVE_LONG_LONG
26814  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
26815 #endif
26816  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
26817  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
26818  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
26819  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
26820  default:
26821  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26822  return 0;
26823  }
26824 }
26825 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
26826  switch (ch) {
26827  case 'c':
26828  return 'H';
26829  case 'b': case 'h': case 'i':
26830  case 'l': case 'q': case 's': case 'p':
26831  return 'I';
26832  case 'B': case 'H': case 'I': case 'L': case 'Q':
26833  return 'U';
26834  case 'f': case 'd': case 'g':
26835  return (is_complex ? 'C' : 'R');
26836  case 'O':
26837  return 'O';
26838  case 'P':
26839  return 'P';
26840  default: {
26841  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26842  return 0;
26843  }
26844  }
26845 }
26846 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26847  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26848  const char* expected;
26849  const char* quote;
26850  if (ctx->head == NULL) {
26851  expected = "end";
26852  quote = "";
26853  } else {
26854  expected = ctx->head->field->type->name;
26855  quote = "'";
26856  }
26857  PyErr_Format(PyExc_ValueError,
26858  "Buffer dtype mismatch, expected %s%s%s but got %s",
26859  quote, expected, quote,
26860  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26861  } else {
26862  __Pyx_StructField* field = ctx->head->field;
26863  __Pyx_StructField* parent = (ctx->head - 1)->field;
26864  PyErr_Format(PyExc_ValueError,
26865  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26866  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26867  parent->type->name, field->name);
26868  }
26869 }
26870 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26871  char group;
26872  size_t size, offset, arraysize = 1;
26873  if (ctx->enc_type == 0) return 0;
26874  if (ctx->head->field->type->arraysize[0]) {
26875  int i, ndim = 0;
26876  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
26877  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26878  ndim = 1;
26879  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26880  PyErr_Format(PyExc_ValueError,
26881  "Expected a dimension of size %zu, got %zu",
26882  ctx->head->field->type->arraysize[0], ctx->enc_count);
26883  return -1;
26884  }
26885  }
26886  if (!ctx->is_valid_array) {
26887  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
26888  ctx->head->field->type->ndim, ndim);
26889  return -1;
26890  }
26891  for (i = 0; i < ctx->head->field->type->ndim; i++) {
26892  arraysize *= ctx->head->field->type->arraysize[i];
26893  }
26894  ctx->is_valid_array = 0;
26895  ctx->enc_count = 1;
26896  }
26897  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26898  do {
26899  __Pyx_StructField* field = ctx->head->field;
26900  __Pyx_TypeInfo* type = field->type;
26901  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
26902  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
26903  } else {
26904  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26905  }
26906  if (ctx->enc_packmode == '@') {
26907  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
26908  size_t align_mod_offset;
26909  if (align_at == 0) return -1;
26910  align_mod_offset = ctx->fmt_offset % align_at;
26911  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
26912  if (ctx->struct_alignment == 0)
26913  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
26914  ctx->is_complex);
26915  }
26916  if (type->size != size || type->typegroup != group) {
26917  if (type->typegroup == 'C' && type->fields != NULL) {
26918  size_t parent_offset = ctx->head->parent_offset + field->offset;
26919  ++ctx->head;
26920  ctx->head->field = type->fields;
26921  ctx->head->parent_offset = parent_offset;
26922  continue;
26923  }
26924  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
26925  } else {
26926  __Pyx_BufFmt_RaiseExpected(ctx);
26927  return -1;
26928  }
26929  }
26930  offset = ctx->head->parent_offset + field->offset;
26931  if (ctx->fmt_offset != offset) {
26932  PyErr_Format(PyExc_ValueError,
26933  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
26934  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
26935  return -1;
26936  }
26937  ctx->fmt_offset += size;
26938  if (arraysize)
26939  ctx->fmt_offset += (arraysize - 1) * size;
26940  --ctx->enc_count;
26941  while (1) {
26942  if (field == &ctx->root) {
26943  ctx->head = NULL;
26944  if (ctx->enc_count != 0) {
26945  __Pyx_BufFmt_RaiseExpected(ctx);
26946  return -1;
26947  }
26948  break;
26949  }
26950  ctx->head->field = ++field;
26951  if (field->type == NULL) {
26952  --ctx->head;
26953  field = ctx->head->field;
26954  continue;
26955  } else if (field->type->typegroup == 'S') {
26956  size_t parent_offset = ctx->head->parent_offset + field->offset;
26957  if (field->type->fields->type == NULL) continue;
26958  field = field->type->fields;
26959  ++ctx->head;
26960  ctx->head->field = field;
26961  ctx->head->parent_offset = parent_offset;
26962  break;
26963  } else {
26964  break;
26965  }
26966  }
26967  } while (ctx->enc_count);
26968  ctx->enc_type = 0;
26969  ctx->is_complex = 0;
26970  return 0;
26971 }
26972 static PyObject *
26973 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
26974 {
26975  const char *ts = *tsp;
26976  int i = 0, number;
26977  int ndim = ctx->head->field->type->ndim;
26978 ;
26979  ++ts;
26980  if (ctx->new_count != 1) {
26981  PyErr_SetString(PyExc_ValueError,
26982  "Cannot handle repeated arrays in format string");
26983  return NULL;
26984  }
26985  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26986  while (*ts && *ts != ')') {
26987  switch (*ts) {
26988  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
26989  default: break;
26990  }
26991  number = __Pyx_BufFmt_ExpectNumber(&ts);
26992  if (number == -1) return NULL;
26993  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
26994  return PyErr_Format(PyExc_ValueError,
26995  "Expected a dimension of size %zu, got %d",
26996  ctx->head->field->type->arraysize[i], number);
26997  if (*ts != ',' && *ts != ')')
26998  return PyErr_Format(PyExc_ValueError,
26999  "Expected a comma in format string, got '%c'", *ts);
27000  if (*ts == ',') ts++;
27001  i++;
27002  }
27003  if (i != ndim)
27004  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
27005  ctx->head->field->type->ndim, i);
27006  if (!*ts) {
27007  PyErr_SetString(PyExc_ValueError,
27008  "Unexpected end of format string, expected ')'");
27009  return NULL;
27010  }
27011  ctx->is_valid_array = 1;
27012  ctx->new_count = 1;
27013  *tsp = ++ts;
27014  return Py_None;
27015 }
27016 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
27017  int got_Z = 0;
27018  while (1) {
27019  switch(*ts) {
27020  case 0:
27021  if (ctx->enc_type != 0 && ctx->head == NULL) {
27022  __Pyx_BufFmt_RaiseExpected(ctx);
27023  return NULL;
27024  }
27025  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27026  if (ctx->head != NULL) {
27027  __Pyx_BufFmt_RaiseExpected(ctx);
27028  return NULL;
27029  }
27030  return ts;
27031  case ' ':
27032  case '\r':
27033  case '\n':
27034  ++ts;
27035  break;
27036  case '<':
27037  if (!__Pyx_Is_Little_Endian()) {
27038  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
27039  return NULL;
27040  }
27041  ctx->new_packmode = '=';
27042  ++ts;
27043  break;
27044  case '>':
27045  case '!':
27046  if (__Pyx_Is_Little_Endian()) {
27047  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
27048  return NULL;
27049  }
27050  ctx->new_packmode = '=';
27051  ++ts;
27052  break;
27053  case '=':
27054  case '@':
27055  case '^':
27056  ctx->new_packmode = *ts++;
27057  break;
27058  case 'T':
27059  {
27060  const char* ts_after_sub;
27061  size_t i, struct_count = ctx->new_count;
27062  size_t struct_alignment = ctx->struct_alignment;
27063  ctx->new_count = 1;
27064  ++ts;
27065  if (*ts != '{') {
27066  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
27067  return NULL;
27068  }
27069  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27070  ctx->enc_type = 0;
27071  ctx->enc_count = 0;
27072  ctx->struct_alignment = 0;
27073  ++ts;
27074  ts_after_sub = ts;
27075  for (i = 0; i != struct_count; ++i) {
27076  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27077  if (!ts_after_sub) return NULL;
27078  }
27079  ts = ts_after_sub;
27080  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27081  }
27082  break;
27083  case '}':
27084  {
27085  size_t alignment = ctx->struct_alignment;
27086  ++ts;
27087  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27088  ctx->enc_type = 0;
27089  if (alignment && ctx->fmt_offset % alignment) {
27090  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27091  }
27092  }
27093  return ts;
27094  case 'x':
27095  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27096  ctx->fmt_offset += ctx->new_count;
27097  ctx->new_count = 1;
27098  ctx->enc_count = 0;
27099  ctx->enc_type = 0;
27100  ctx->enc_packmode = ctx->new_packmode;
27101  ++ts;
27102  break;
27103  case 'Z':
27104  got_Z = 1;
27105  ++ts;
27106  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27107  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27108  return NULL;
27109  }
27110  CYTHON_FALLTHROUGH;
27111  case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27112  case 'l': case 'L': case 'q': case 'Q':
27113  case 'f': case 'd': case 'g':
27114  case 'O': case 'p':
27115  if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
27116  ctx->enc_packmode == ctx->new_packmode) {
27117  ctx->enc_count += ctx->new_count;
27118  ctx->new_count = 1;
27119  got_Z = 0;
27120  ++ts;
27121  break;
27122  }
27123  CYTHON_FALLTHROUGH;
27124  case 's':
27125  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27126  ctx->enc_count = ctx->new_count;
27127  ctx->enc_packmode = ctx->new_packmode;
27128  ctx->enc_type = *ts;
27129  ctx->is_complex = got_Z;
27130  ++ts;
27131  ctx->new_count = 1;
27132  got_Z = 0;
27133  break;
27134  case ':':
27135  ++ts;
27136  while(*ts != ':') ++ts;
27137  ++ts;
27138  break;
27139  case '(':
27140  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27141  break;
27142  default:
27143  {
27144  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27145  if (number == -1) return NULL;
27146  ctx->new_count = (size_t)number;
27147  }
27148  }
27149  }
27150 }
27151 
27152 /* TypeInfoCompare */
27153  static int
27154 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27155 {
27156  int i;
27157  if (!a || !b)
27158  return 0;
27159  if (a == b)
27160  return 1;
27161  if (a->size != b->size || a->typegroup != b->typegroup ||
27162  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27163  if (a->typegroup == 'H' || b->typegroup == 'H') {
27164  return a->size == b->size;
27165  } else {
27166  return 0;
27167  }
27168  }
27169  if (a->ndim) {
27170  for (i = 0; i < a->ndim; i++)
27171  if (a->arraysize[i] != b->arraysize[i])
27172  return 0;
27173  }
27174  if (a->typegroup == 'S') {
27175  if (a->flags != b->flags)
27176  return 0;
27177  if (a->fields || b->fields) {
27178  if (!(a->fields && b->fields))
27179  return 0;
27180  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27181  __Pyx_StructField *field_a = a->fields + i;
27182  __Pyx_StructField *field_b = b->fields + i;
27183  if (field_a->offset != field_b->offset ||
27184  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27185  return 0;
27186  }
27187  return !a->fields[i].type && !b->fields[i].type;
27188  }
27189  }
27190  return 1;
27191 }
27192 
27193 /* MemviewSliceValidateAndInit */
27194  static int
27195 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27196 {
27197  if (buf->shape[dim] <= 1)
27198  return 1;
27199  if (buf->strides) {
27200  if (spec & __Pyx_MEMVIEW_CONTIG) {
27201  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27202  if (buf->strides[dim] != sizeof(void *)) {
27203  PyErr_Format(PyExc_ValueError,
27204  "Buffer is not indirectly contiguous "
27205  "in dimension %d.", dim);
27206  goto fail;
27207  }
27208  } else if (buf->strides[dim] != buf->itemsize) {
27209  PyErr_SetString(PyExc_ValueError,
27210  "Buffer and memoryview are not contiguous "
27211  "in the same dimension.");
27212  goto fail;
27213  }
27214  }
27215  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27216  Py_ssize_t stride = buf->strides[dim];
27217  if (stride < 0)
27218  stride = -stride;
27219  if (stride < buf->itemsize) {
27220  PyErr_SetString(PyExc_ValueError,
27221  "Buffer and memoryview are not contiguous "
27222  "in the same dimension.");
27223  goto fail;
27224  }
27225  }
27226  } else {
27227  if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
27228  PyErr_Format(PyExc_ValueError,
27229  "C-contiguous buffer is not contiguous in "
27230  "dimension %d", dim);
27231  goto fail;
27232  } else if (spec & (__Pyx_MEMVIEW_PTR)) {
27233  PyErr_Format(PyExc_ValueError,
27234  "C-contiguous buffer is not indirect in "
27235  "dimension %d", dim);
27236  goto fail;
27237  } else if (buf->suboffsets) {
27238  PyErr_SetString(PyExc_ValueError,
27239  "Buffer exposes suboffsets but no strides");
27240  goto fail;
27241  }
27242  }
27243  return 1;
27244 fail:
27245  return 0;
27246 }
27247 static int
27248 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27249 {
27250  if (spec & __Pyx_MEMVIEW_DIRECT) {
27251  if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
27252  PyErr_Format(PyExc_ValueError,
27253  "Buffer not compatible with direct access "
27254  "in dimension %d.", dim);
27255  goto fail;
27256  }
27257  }
27258  if (spec & __Pyx_MEMVIEW_PTR) {
27259  if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
27260  PyErr_Format(PyExc_ValueError,
27261  "Buffer is not indirectly accessible "
27262  "in dimension %d.", dim);
27263  goto fail;
27264  }
27265  }
27266  return 1;
27267 fail:
27268  return 0;
27269 }
27270 static int
27271 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
27272 {
27273  int i;
27274  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27275  Py_ssize_t stride = 1;
27276  for (i = 0; i < ndim; i++) {
27277  if (stride * buf->itemsize != buf->strides[i] &&
27278  buf->shape[i] > 1)
27279  {
27280  PyErr_SetString(PyExc_ValueError,
27281  "Buffer not fortran contiguous.");
27282  goto fail;
27283  }
27284  stride = stride * buf->shape[i];
27285  }
27286  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27287  Py_ssize_t stride = 1;
27288  for (i = ndim - 1; i >- 1; i--) {
27289  if (stride * buf->itemsize != buf->strides[i] &&
27290  buf->shape[i] > 1) {
27291  PyErr_SetString(PyExc_ValueError,
27292  "Buffer not C contiguous.");
27293  goto fail;
27294  }
27295  stride = stride * buf->shape[i];
27296  }
27297  }
27298  return 1;
27299 fail:
27300  return 0;
27301 }
27302 static int __Pyx_ValidateAndInit_memviewslice(
27303  int *axes_specs,
27304  int c_or_f_flag,
27305  int buf_flags,
27306  int ndim,
27307  __Pyx_TypeInfo *dtype,
27308  __Pyx_BufFmt_StackElem stack[],
27309  __Pyx_memviewslice *memviewslice,
27310  PyObject *original_obj)
27311 {
27312  struct __pyx_memoryview_obj *memview, *new_memview;
27313  __Pyx_RefNannyDeclarations
27314  Py_buffer *buf;
27315  int i, spec = 0, retval = -1;
27316  __Pyx_BufFmt_Context ctx;
27317  int from_memoryview = __pyx_memoryview_check(original_obj);
27318  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
27319  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
27320  original_obj)->typeinfo)) {
27321  memview = (struct __pyx_memoryview_obj *) original_obj;
27322  new_memview = NULL;
27323  } else {
27324  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27325  original_obj, buf_flags, 0, dtype);
27326  new_memview = memview;
27327  if (unlikely(!memview))
27328  goto fail;
27329  }
27330  buf = &memview->view;
27331  if (buf->ndim != ndim) {
27332  PyErr_Format(PyExc_ValueError,
27333  "Buffer has wrong number of dimensions (expected %d, got %d)",
27334  ndim, buf->ndim);
27335  goto fail;
27336  }
27337  if (new_memview) {
27338  __Pyx_BufFmt_Init(&ctx, stack, dtype);
27339  if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
27340  }
27341  if ((unsigned) buf->itemsize != dtype->size) {
27342  PyErr_Format(PyExc_ValueError,
27343  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
27344  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
27345  buf->itemsize,
27346  (buf->itemsize > 1) ? "s" : "",
27347  dtype->name,
27348  dtype->size,
27349  (dtype->size > 1) ? "s" : "");
27350  goto fail;
27351  }
27352  for (i = 0; i < ndim; i++) {
27353  spec = axes_specs[i];
27354  if (!__pyx_check_strides(buf, i, ndim, spec))
27355  goto fail;
27356  if (!__pyx_check_suboffsets(buf, i, ndim, spec))
27357  goto fail;
27358  }
27359  if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
27360  goto fail;
27361  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27362  new_memview != NULL) == -1)) {
27363  goto fail;
27364  }
27365  retval = 0;
27366  goto no_fail;
27367 fail:
27368  Py_XDECREF(new_memview);
27369  retval = -1;
27370 no_fail:
27371  __Pyx_RefNannyFinishContext();
27372  return retval;
27373 }
27374 
27375 /* ObjectToMemviewSlice */
27376  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
27377  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27378  __Pyx_BufFmt_StackElem stack[1];
27379  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27380  int retcode;
27381  if (obj == Py_None) {
27382  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27383  return result;
27384  }
27385  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27386  PyBUF_RECORDS_RO | writable_flag, 1,
27387  &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
27388  &result, obj);
27389  if (unlikely(retcode == -1))
27390  goto __pyx_fail;
27391  return result;
27392 __pyx_fail:
27393  result.memview = NULL;
27394  result.data = NULL;
27395  return result;
27396 }
27397 
27398 /* ObjectToMemviewSlice */
27399  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj, int writable_flag) {
27400  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27401  __Pyx_BufFmt_StackElem stack[1];
27402  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27403  int retcode;
27404  if (obj == Py_None) {
27405  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27406  return result;
27407  }
27408  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27409  PyBUF_RECORDS_RO | writable_flag, 1,
27410  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
27411  &result, obj);
27412  if (unlikely(retcode == -1))
27413  goto __pyx_fail;
27414  return result;
27415 __pyx_fail:
27416  result.memview = NULL;
27417  result.data = NULL;
27418  return result;
27419 }
27420 
27421 /* CIntToPy */
27422  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
27423  const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
27424  const int is_unsigned = neg_one > const_zero;
27425  if (is_unsigned) {
27426  if (sizeof(npy_int32) < sizeof(long)) {
27427  return PyInt_FromLong((long) value);
27428  } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
27429  return PyLong_FromUnsignedLong((unsigned long) value);
27430 #ifdef HAVE_LONG_LONG
27431  } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
27432  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27433 #endif
27434  }
27435  } else {
27436  if (sizeof(npy_int32) <= sizeof(long)) {
27437  return PyInt_FromLong((long) value);
27438 #ifdef HAVE_LONG_LONG
27439  } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
27440  return PyLong_FromLongLong((PY_LONG_LONG) value);
27441 #endif
27442  }
27443  }
27444  {
27445  int one = 1; int little = (int)*(unsigned char *)&one;
27446  unsigned char *bytes = (unsigned char *)&value;
27447  return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
27448  little, !is_unsigned);
27449  }
27450 }
27451 
27452 /* CIntToPy */
27453  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27454  const int neg_one = (int) -1, const_zero = (int) 0;
27455  const int is_unsigned = neg_one > const_zero;
27456  if (is_unsigned) {
27457  if (sizeof(int) < sizeof(long)) {
27458  return PyInt_FromLong((long) value);
27459  } else if (sizeof(int) <= sizeof(unsigned long)) {
27460  return PyLong_FromUnsignedLong((unsigned long) value);
27461 #ifdef HAVE_LONG_LONG
27462  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27463  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27464 #endif
27465  }
27466  } else {
27467  if (sizeof(int) <= sizeof(long)) {
27468  return PyInt_FromLong((long) value);
27469 #ifdef HAVE_LONG_LONG
27470  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27471  return PyLong_FromLongLong((PY_LONG_LONG) value);
27472 #endif
27473  }
27474  }
27475  {
27476  int one = 1; int little = (int)*(unsigned char *)&one;
27477  unsigned char *bytes = (unsigned char *)&value;
27478  return _PyLong_FromByteArray(bytes, sizeof(int),
27479  little, !is_unsigned);
27480  }
27481 }
27482 
27483 /* Declarations */
27484  #if CYTHON_CCOMPLEX
27485  #ifdef __cplusplus
27486  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27487  return ::std::complex< float >(x, y);
27488  }
27489  #else
27490  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27491  return x + y*(__pyx_t_float_complex)_Complex_I;
27492  }
27493  #endif
27494 #else
27495  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27496  __pyx_t_float_complex z;
27497  z.real = x;
27498  z.imag = y;
27499  return z;
27500  }
27501 #endif
27502 
27503 /* Arithmetic */
27504  #if CYTHON_CCOMPLEX
27505 #else
27506  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27507  return (a.real == b.real) && (a.imag == b.imag);
27508  }
27509  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27510  __pyx_t_float_complex z;
27511  z.real = a.real + b.real;
27512  z.imag = a.imag + b.imag;
27513  return z;
27514  }
27515  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27516  __pyx_t_float_complex z;
27517  z.real = a.real - b.real;
27518  z.imag = a.imag - b.imag;
27519  return z;
27520  }
27521  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27522  __pyx_t_float_complex z;
27523  z.real = a.real * b.real - a.imag * b.imag;
27524  z.imag = a.real * b.imag + a.imag * b.real;
27525  return z;
27526  }
27527  #if 1
27528  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27529  if (b.imag == 0) {
27530  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27531  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27532  if (b.real == 0 && b.imag == 0) {
27533  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27534  } else {
27535  float r = b.imag / b.real;
27536  float s = 1.0 / (b.real + b.imag * r);
27537  return __pyx_t_float_complex_from_parts(
27538  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27539  }
27540  } else {
27541  float r = b.real / b.imag;
27542  float s = 1.0 / (b.imag + b.real * r);
27543  return __pyx_t_float_complex_from_parts(
27544  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27545  }
27546  }
27547  #else
27548  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27549  if (b.imag == 0) {
27550  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27551  } else {
27552  float denom = b.real * b.real + b.imag * b.imag;
27553  return __pyx_t_float_complex_from_parts(
27554  (a.real * b.real + a.imag * b.imag) / denom,
27555  (a.imag * b.real - a.real * b.imag) / denom);
27556  }
27557  }
27558  #endif
27559  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27560  __pyx_t_float_complex z;
27561  z.real = -a.real;
27562  z.imag = -a.imag;
27563  return z;
27564  }
27565  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27566  return (a.real == 0) && (a.imag == 0);
27567  }
27568  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27569  __pyx_t_float_complex z;
27570  z.real = a.real;
27571  z.imag = -a.imag;
27572  return z;
27573  }
27574  #if 1
27575  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27576  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27577  return sqrtf(z.real*z.real + z.imag*z.imag);
27578  #else
27579  return hypotf(z.real, z.imag);
27580  #endif
27581  }
27582  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27583  __pyx_t_float_complex z;
27584  float r, lnr, theta, z_r, z_theta;
27585  if (b.imag == 0 && b.real == (int)b.real) {
27586  if (b.real < 0) {
27587  float denom = a.real * a.real + a.imag * a.imag;
27588  a.real = a.real / denom;
27589  a.imag = -a.imag / denom;
27590  b.real = -b.real;
27591  }
27592  switch ((int)b.real) {
27593  case 0:
27594  z.real = 1;
27595  z.imag = 0;
27596  return z;
27597  case 1:
27598  return a;
27599  case 2:
27600  z = __Pyx_c_prod_float(a, a);
27601  return __Pyx_c_prod_float(a, a);
27602  case 3:
27603  z = __Pyx_c_prod_float(a, a);
27604  return __Pyx_c_prod_float(z, a);
27605  case 4:
27606  z = __Pyx_c_prod_float(a, a);
27607  return __Pyx_c_prod_float(z, z);
27608  }
27609  }
27610  if (a.imag == 0) {
27611  if (a.real == 0) {
27612  return a;
27613  } else if (b.imag == 0) {
27614  z.real = powf(a.real, b.real);
27615  z.imag = 0;
27616  return z;
27617  } else if (a.real > 0) {
27618  r = a.real;
27619  theta = 0;
27620  } else {
27621  r = -a.real;
27622  theta = atan2f(0, -1);
27623  }
27624  } else {
27625  r = __Pyx_c_abs_float(a);
27626  theta = atan2f(a.imag, a.real);
27627  }
27628  lnr = logf(r);
27629  z_r = expf(lnr * b.real - theta * b.imag);
27630  z_theta = theta * b.real + lnr * b.imag;
27631  z.real = z_r * cosf(z_theta);
27632  z.imag = z_r * sinf(z_theta);
27633  return z;
27634  }
27635  #endif
27636 #endif
27637 
27638 /* Declarations */
27639  #if CYTHON_CCOMPLEX
27640  #ifdef __cplusplus
27641  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27642  return ::std::complex< double >(x, y);
27643  }
27644  #else
27645  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27646  return x + y*(__pyx_t_double_complex)_Complex_I;
27647  }
27648  #endif
27649 #else
27650  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27651  __pyx_t_double_complex z;
27652  z.real = x;
27653  z.imag = y;
27654  return z;
27655  }
27656 #endif
27657 
27658 /* Arithmetic */
27659  #if CYTHON_CCOMPLEX
27660 #else
27661  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27662  return (a.real == b.real) && (a.imag == b.imag);
27663  }
27664  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27665  __pyx_t_double_complex z;
27666  z.real = a.real + b.real;
27667  z.imag = a.imag + b.imag;
27668  return z;
27669  }
27670  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27671  __pyx_t_double_complex z;
27672  z.real = a.real - b.real;
27673  z.imag = a.imag - b.imag;
27674  return z;
27675  }
27676  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27677  __pyx_t_double_complex z;
27678  z.real = a.real * b.real - a.imag * b.imag;
27679  z.imag = a.real * b.imag + a.imag * b.real;
27680  return z;
27681  }
27682  #if 1
27683  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27684  if (b.imag == 0) {
27685  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27686  } else if (fabs(b.real) >= fabs(b.imag)) {
27687  if (b.real == 0 && b.imag == 0) {
27688  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27689  } else {
27690  double r = b.imag / b.real;
27691  double s = 1.0 / (b.real + b.imag * r);
27692  return __pyx_t_double_complex_from_parts(
27693  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27694  }
27695  } else {
27696  double r = b.real / b.imag;
27697  double s = 1.0 / (b.imag + b.real * r);
27698  return __pyx_t_double_complex_from_parts(
27699  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27700  }
27701  }
27702  #else
27703  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27704  if (b.imag == 0) {
27705  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27706  } else {
27707  double denom = b.real * b.real + b.imag * b.imag;
27708  return __pyx_t_double_complex_from_parts(
27709  (a.real * b.real + a.imag * b.imag) / denom,
27710  (a.imag * b.real - a.real * b.imag) / denom);
27711  }
27712  }
27713  #endif
27714  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27715  __pyx_t_double_complex z;
27716  z.real = -a.real;
27717  z.imag = -a.imag;
27718  return z;
27719  }
27720  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27721  return (a.real == 0) && (a.imag == 0);
27722  }
27723  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27724  __pyx_t_double_complex z;
27725  z.real = a.real;
27726  z.imag = -a.imag;
27727  return z;
27728  }
27729  #if 1
27730  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27731  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27732  return sqrt(z.real*z.real + z.imag*z.imag);
27733  #else
27734  return hypot(z.real, z.imag);
27735  #endif
27736  }
27737  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27738  __pyx_t_double_complex z;
27739  double r, lnr, theta, z_r, z_theta;
27740  if (b.imag == 0 && b.real == (int)b.real) {
27741  if (b.real < 0) {
27742  double denom = a.real * a.real + a.imag * a.imag;
27743  a.real = a.real / denom;
27744  a.imag = -a.imag / denom;
27745  b.real = -b.real;
27746  }
27747  switch ((int)b.real) {
27748  case 0:
27749  z.real = 1;
27750  z.imag = 0;
27751  return z;
27752  case 1:
27753  return a;
27754  case 2:
27755  z = __Pyx_c_prod_double(a, a);
27756  return __Pyx_c_prod_double(a, a);
27757  case 3:
27758  z = __Pyx_c_prod_double(a, a);
27759  return __Pyx_c_prod_double(z, a);
27760  case 4:
27761  z = __Pyx_c_prod_double(a, a);
27762  return __Pyx_c_prod_double(z, z);
27763  }
27764  }
27765  if (a.imag == 0) {
27766  if (a.real == 0) {
27767  return a;
27768  } else if (b.imag == 0) {
27769  z.real = pow(a.real, b.real);
27770  z.imag = 0;
27771  return z;
27772  } else if (a.real > 0) {
27773  r = a.real;
27774  theta = 0;
27775  } else {
27776  r = -a.real;
27777  theta = atan2(0, -1);
27778  }
27779  } else {
27780  r = __Pyx_c_abs_double(a);
27781  theta = atan2(a.imag, a.real);
27782  }
27783  lnr = log(r);
27784  z_r = exp(lnr * b.real - theta * b.imag);
27785  z_theta = theta * b.real + lnr * b.imag;
27786  z.real = z_r * cos(z_theta);
27787  z.imag = z_r * sin(z_theta);
27788  return z;
27789  }
27790  #endif
27791 #endif
27792 
27793 /* CIntToPy */
27794  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
27795  const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
27796  const int is_unsigned = neg_one > const_zero;
27797  if (is_unsigned) {
27798  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
27799  return PyInt_FromLong((long) value);
27800  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
27801  return PyLong_FromUnsignedLong((unsigned long) value);
27802 #ifdef HAVE_LONG_LONG
27803  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
27804  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27805 #endif
27806  }
27807  } else {
27808  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
27809  return PyInt_FromLong((long) value);
27810 #ifdef HAVE_LONG_LONG
27811  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
27812  return PyLong_FromLongLong((PY_LONG_LONG) value);
27813 #endif
27814  }
27815  }
27816  {
27817  int one = 1; int little = (int)*(unsigned char *)&one;
27818  unsigned char *bytes = (unsigned char *)&value;
27819  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
27820  little, !is_unsigned);
27821  }
27822 }
27823 
27824 /* MemviewSliceCopyTemplate */
27825  static __Pyx_memviewslice
27826 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27827  const char *mode, int ndim,
27828  size_t sizeof_dtype, int contig_flag,
27829  int dtype_is_object)
27830 {
27831  __Pyx_RefNannyDeclarations
27832  int i;
27833  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27834  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27835  Py_buffer *buf = &from_memview->view;
27836  PyObject *shape_tuple = NULL;
27837  PyObject *temp_int = NULL;
27838  struct __pyx_array_obj *array_obj = NULL;
27839  struct __pyx_memoryview_obj *memview_obj = NULL;
27840  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27841  for (i = 0; i < ndim; i++) {
27842  if (from_mvs->suboffsets[i] >= 0) {
27843  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27844  "indirect dimensions (axis %d)", i);
27845  goto fail;
27846  }
27847  }
27848  shape_tuple = PyTuple_New(ndim);
27849  if (unlikely(!shape_tuple)) {
27850  goto fail;
27851  }
27852  __Pyx_GOTREF(shape_tuple);
27853  for(i = 0; i < ndim; i++) {
27854  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27855  if(unlikely(!temp_int)) {
27856  goto fail;
27857  } else {
27858  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27859  temp_int = NULL;
27860  }
27861  }
27862  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27863  if (unlikely(!array_obj)) {
27864  goto fail;
27865  }
27866  __Pyx_GOTREF(array_obj);
27867  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27868  (PyObject *) array_obj, contig_flag,
27869  dtype_is_object,
27870  from_mvs->memview->typeinfo);
27871  if (unlikely(!memview_obj))
27872  goto fail;
27873  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27874  goto fail;
27875  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27876  dtype_is_object) < 0))
27877  goto fail;
27878  goto no_fail;
27879 fail:
27880  __Pyx_XDECREF(new_mvs.memview);
27881  new_mvs.memview = NULL;
27882  new_mvs.data = NULL;
27883 no_fail:
27884  __Pyx_XDECREF(shape_tuple);
27885  __Pyx_XDECREF(temp_int);
27886  __Pyx_XDECREF(array_obj);
27887  __Pyx_RefNannyFinishContext();
27888  return new_mvs;
27889 }
27890 
27891 /* CIntFromPy */
27892  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
27893  const int neg_one = (int) -1, const_zero = (int) 0;
27894  const int is_unsigned = neg_one > const_zero;
27895 #if PY_MAJOR_VERSION < 3
27896  if (likely(PyInt_Check(x))) {
27897  if (sizeof(int) < sizeof(long)) {
27898  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
27899  } else {
27900  long val = PyInt_AS_LONG(x);
27901  if (is_unsigned && unlikely(val < 0)) {
27902  goto raise_neg_overflow;
27903  }
27904  return (int) val;
27905  }
27906  } else
27907 #endif
27908  if (likely(PyLong_Check(x))) {
27909  if (is_unsigned) {
27910 #if CYTHON_USE_PYLONG_INTERNALS
27911  const digit* digits = ((PyLongObject*)x)->ob_digit;
27912  switch (Py_SIZE(x)) {
27913  case 0: return (int) 0;
27914  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
27915  case 2:
27916  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27917  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27918  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27919  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
27920  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27921  }
27922  }
27923  break;
27924  case 3:
27925  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27926  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27927  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27928  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
27929  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27930  }
27931  }
27932  break;
27933  case 4:
27934  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27935  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27936  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27937  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
27938  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27939  }
27940  }
27941  break;
27942  }
27943 #endif
27944 #if CYTHON_COMPILING_IN_CPYTHON
27945  if (unlikely(Py_SIZE(x) < 0)) {
27946  goto raise_neg_overflow;
27947  }
27948 #else
27949  {
27950  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27951  if (unlikely(result < 0))
27952  return (int) -1;
27953  if (unlikely(result == 1))
27954  goto raise_neg_overflow;
27955  }
27956 #endif
27957  if (sizeof(int) <= sizeof(unsigned long)) {
27958  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
27959 #ifdef HAVE_LONG_LONG
27960  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27961  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27962 #endif
27963  }
27964  } else {
27965 #if CYTHON_USE_PYLONG_INTERNALS
27966  const digit* digits = ((PyLongObject*)x)->ob_digit;
27967  switch (Py_SIZE(x)) {
27968  case 0: return (int) 0;
27969  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
27970  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
27971  case -2:
27972  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
27973  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27974  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27975  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27976  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27977  }
27978  }
27979  break;
27980  case 2:
27981  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27982  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27983  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27984  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27985  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27986  }
27987  }
27988  break;
27989  case -3:
27990  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27991  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27992  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27993  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27994  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27995  }
27996  }
27997  break;
27998  case 3:
27999  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28000  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28001  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28002  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28003  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28004  }
28005  }
28006  break;
28007  case -4:
28008  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28009  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28010  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28011  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28012  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28013  }
28014  }
28015  break;
28016  case 4:
28017  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28018  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28019  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28020  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28021  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28022  }
28023  }
28024  break;
28025  }
28026 #endif
28027  if (sizeof(int) <= sizeof(long)) {
28028  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28029 #ifdef HAVE_LONG_LONG
28030  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28031  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28032 #endif
28033  }
28034  }
28035  {
28036 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28037  PyErr_SetString(PyExc_RuntimeError,
28038  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28039 #else
28040  int val;
28041  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28042  #if PY_MAJOR_VERSION < 3
28043  if (likely(v) && !PyLong_Check(v)) {
28044  PyObject *tmp = v;
28045  v = PyNumber_Long(tmp);
28046  Py_DECREF(tmp);
28047  }
28048  #endif
28049  if (likely(v)) {
28050  int one = 1; int is_little = (int)*(unsigned char *)&one;
28051  unsigned char *bytes = (unsigned char *)&val;
28052  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28053  bytes, sizeof(val),
28054  is_little, !is_unsigned);
28055  Py_DECREF(v);
28056  if (likely(!ret))
28057  return val;
28058  }
28059 #endif
28060  return (int) -1;
28061  }
28062  } else {
28063  int val;
28064  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28065  if (!tmp) return (int) -1;
28066  val = __Pyx_PyInt_As_int(tmp);
28067  Py_DECREF(tmp);
28068  return val;
28069  }
28070 raise_overflow:
28071  PyErr_SetString(PyExc_OverflowError,
28072  "value too large to convert to int");
28073  return (int) -1;
28074 raise_neg_overflow:
28075  PyErr_SetString(PyExc_OverflowError,
28076  "can't convert negative value to int");
28077  return (int) -1;
28078 }
28079 
28080 /* CIntFromPy */
28081  static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
28082  const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
28083  const int is_unsigned = neg_one > const_zero;
28084 #if PY_MAJOR_VERSION < 3
28085  if (likely(PyInt_Check(x))) {
28086  if (sizeof(npy_int32) < sizeof(long)) {
28087  __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
28088  } else {
28089  long val = PyInt_AS_LONG(x);
28090  if (is_unsigned && unlikely(val < 0)) {
28091  goto raise_neg_overflow;
28092  }
28093  return (npy_int32) val;
28094  }
28095  } else
28096 #endif
28097  if (likely(PyLong_Check(x))) {
28098  if (is_unsigned) {
28099 #if CYTHON_USE_PYLONG_INTERNALS
28100  const digit* digits = ((PyLongObject*)x)->ob_digit;
28101  switch (Py_SIZE(x)) {
28102  case 0: return (npy_int32) 0;
28103  case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
28104  case 2:
28105  if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
28106  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28107  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28108  } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
28109  return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
28110  }
28111  }
28112  break;
28113  case 3:
28114  if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
28115  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28116  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28117  } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
28118  return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
28119  }
28120  }
28121  break;
28122  case 4:
28123  if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
28124  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28125  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28126  } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
28127  return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
28128  }
28129  }
28130  break;
28131  }
28132 #endif
28133 #if CYTHON_COMPILING_IN_CPYTHON
28134  if (unlikely(Py_SIZE(x) < 0)) {
28135  goto raise_neg_overflow;
28136  }
28137 #else
28138  {
28139  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28140  if (unlikely(result < 0))
28141  return (npy_int32) -1;
28142  if (unlikely(result == 1))
28143  goto raise_neg_overflow;
28144  }
28145 #endif
28146  if (sizeof(npy_int32) <= sizeof(unsigned long)) {
28147  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
28148 #ifdef HAVE_LONG_LONG
28149  } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
28150  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28151 #endif
28152  }
28153  } else {
28154 #if CYTHON_USE_PYLONG_INTERNALS
28155  const digit* digits = ((PyLongObject*)x)->ob_digit;
28156  switch (Py_SIZE(x)) {
28157  case 0: return (npy_int32) 0;
28158  case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
28159  case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0])
28160  case -2:
28161  if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
28162  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28163  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28164  } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
28165  return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28166  }
28167  }
28168  break;
28169  case 2:
28170  if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
28171  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28172  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28173  } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
28174  return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28175  }
28176  }
28177  break;
28178  case -3:
28179  if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
28180  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28181  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28182  } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
28183  return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28184  }
28185  }
28186  break;
28187  case 3:
28188  if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
28189  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28190  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28191  } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
28192  return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28193  }
28194  }
28195  break;
28196  case -4:
28197  if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
28198  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28199  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28200  } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
28201  return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28202  }
28203  }
28204  break;
28205  case 4:
28206  if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
28207  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28208  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28209  } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
28210  return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28211  }
28212  }
28213  break;
28214  }
28215 #endif
28216  if (sizeof(npy_int32) <= sizeof(long)) {
28217  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
28218 #ifdef HAVE_LONG_LONG
28219  } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
28220  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
28221 #endif
28222  }
28223  }
28224  {
28225 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28226  PyErr_SetString(PyExc_RuntimeError,
28227  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28228 #else
28229  npy_int32 val;
28230  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28231  #if PY_MAJOR_VERSION < 3
28232  if (likely(v) && !PyLong_Check(v)) {
28233  PyObject *tmp = v;
28234  v = PyNumber_Long(tmp);
28235  Py_DECREF(tmp);
28236  }
28237  #endif
28238  if (likely(v)) {
28239  int one = 1; int is_little = (int)*(unsigned char *)&one;
28240  unsigned char *bytes = (unsigned char *)&val;
28241  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28242  bytes, sizeof(val),
28243  is_little, !is_unsigned);
28244  Py_DECREF(v);
28245  if (likely(!ret))
28246  return val;
28247  }
28248 #endif
28249  return (npy_int32) -1;
28250  }
28251  } else {
28252  npy_int32 val;
28253  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28254  if (!tmp) return (npy_int32) -1;
28255  val = __Pyx_PyInt_As_npy_int32(tmp);
28256  Py_DECREF(tmp);
28257  return val;
28258  }
28259 raise_overflow:
28260  PyErr_SetString(PyExc_OverflowError,
28261  "value too large to convert to npy_int32");
28262  return (npy_int32) -1;
28263 raise_neg_overflow:
28264  PyErr_SetString(PyExc_OverflowError,
28265  "can't convert negative value to npy_int32");
28266  return (npy_int32) -1;
28267 }
28268 
28269 /* CIntFromPy */
28270  static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
28271  const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
28272  const int is_unsigned = neg_one > const_zero;
28273 #if PY_MAJOR_VERSION < 3
28274  if (likely(PyInt_Check(x))) {
28275  if (sizeof(size_t) < sizeof(long)) {
28276  __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
28277  } else {
28278  long val = PyInt_AS_LONG(x);
28279  if (is_unsigned && unlikely(val < 0)) {
28280  goto raise_neg_overflow;
28281  }
28282  return (size_t) val;
28283  }
28284  } else
28285 #endif
28286  if (likely(PyLong_Check(x))) {
28287  if (is_unsigned) {
28288 #if CYTHON_USE_PYLONG_INTERNALS
28289  const digit* digits = ((PyLongObject*)x)->ob_digit;
28290  switch (Py_SIZE(x)) {
28291  case 0: return (size_t) 0;
28292  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
28293  case 2:
28294  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
28295  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28296  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28297  } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
28298  return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28299  }
28300  }
28301  break;
28302  case 3:
28303  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
28304  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28305  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28306  } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
28307  return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28308  }
28309  }
28310  break;
28311  case 4:
28312  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
28313  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28314  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28315  } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
28316  return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28317  }
28318  }
28319  break;
28320  }
28321 #endif
28322 #if CYTHON_COMPILING_IN_CPYTHON
28323  if (unlikely(Py_SIZE(x) < 0)) {
28324  goto raise_neg_overflow;
28325  }
28326 #else
28327  {
28328  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28329  if (unlikely(result < 0))
28330  return (size_t) -1;
28331  if (unlikely(result == 1))
28332  goto raise_neg_overflow;
28333  }
28334 #endif
28335  if (sizeof(size_t) <= sizeof(unsigned long)) {
28336  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
28337 #ifdef HAVE_LONG_LONG
28338  } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
28339  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28340 #endif
28341  }
28342  } else {
28343 #if CYTHON_USE_PYLONG_INTERNALS
28344  const digit* digits = ((PyLongObject*)x)->ob_digit;
28345  switch (Py_SIZE(x)) {
28346  case 0: return (size_t) 0;
28347  case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
28348  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
28349  case -2:
28350  if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
28351  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28352  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28353  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
28354  return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28355  }
28356  }
28357  break;
28358  case 2:
28359  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
28360  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28361  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28362  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
28363  return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28364  }
28365  }
28366  break;
28367  case -3:
28368  if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
28369  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28370  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28371  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
28372  return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28373  }
28374  }
28375  break;
28376  case 3:
28377  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
28378  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28379  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28380  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
28381  return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28382  }
28383  }
28384  break;
28385  case -4:
28386  if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
28387  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28388  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28389  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
28390  return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28391  }
28392  }
28393  break;
28394  case 4:
28395  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
28396  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28397  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28398  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
28399  return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28400  }
28401  }
28402  break;
28403  }
28404 #endif
28405  if (sizeof(size_t) <= sizeof(long)) {
28406  __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
28407 #ifdef HAVE_LONG_LONG
28408  } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
28409  __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
28410 #endif
28411  }
28412  }
28413  {
28414 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28415  PyErr_SetString(PyExc_RuntimeError,
28416  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28417 #else
28418  size_t val;
28419  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28420  #if PY_MAJOR_VERSION < 3
28421  if (likely(v) && !PyLong_Check(v)) {
28422  PyObject *tmp = v;
28423  v = PyNumber_Long(tmp);
28424  Py_DECREF(tmp);
28425  }
28426  #endif
28427  if (likely(v)) {
28428  int one = 1; int is_little = (int)*(unsigned char *)&one;
28429  unsigned char *bytes = (unsigned char *)&val;
28430  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28431  bytes, sizeof(val),
28432  is_little, !is_unsigned);
28433  Py_DECREF(v);
28434  if (likely(!ret))
28435  return val;
28436  }
28437 #endif
28438  return (size_t) -1;
28439  }
28440  } else {
28441  size_t val;
28442  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28443  if (!tmp) return (size_t) -1;
28444  val = __Pyx_PyInt_As_size_t(tmp);
28445  Py_DECREF(tmp);
28446  return val;
28447  }
28448 raise_overflow:
28449  PyErr_SetString(PyExc_OverflowError,
28450  "value too large to convert to size_t");
28451  return (size_t) -1;
28452 raise_neg_overflow:
28453  PyErr_SetString(PyExc_OverflowError,
28454  "can't convert negative value to size_t");
28455  return (size_t) -1;
28456 }
28457 
28458 /* CIntFromPy */
28459  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28460  const long neg_one = (long) -1, const_zero = (long) 0;
28461  const int is_unsigned = neg_one > const_zero;
28462 #if PY_MAJOR_VERSION < 3
28463  if (likely(PyInt_Check(x))) {
28464  if (sizeof(long) < sizeof(long)) {
28465  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28466  } else {
28467  long val = PyInt_AS_LONG(x);
28468  if (is_unsigned && unlikely(val < 0)) {
28469  goto raise_neg_overflow;
28470  }
28471  return (long) val;
28472  }
28473  } else
28474 #endif
28475  if (likely(PyLong_Check(x))) {
28476  if (is_unsigned) {
28477 #if CYTHON_USE_PYLONG_INTERNALS
28478  const digit* digits = ((PyLongObject*)x)->ob_digit;
28479  switch (Py_SIZE(x)) {
28480  case 0: return (long) 0;
28481  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28482  case 2:
28483  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28484  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28485  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28486  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28487  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28488  }
28489  }
28490  break;
28491  case 3:
28492  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28493  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28494  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28495  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28496  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28497  }
28498  }
28499  break;
28500  case 4:
28501  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28502  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28503  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28504  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28505  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28506  }
28507  }
28508  break;
28509  }
28510 #endif
28511 #if CYTHON_COMPILING_IN_CPYTHON
28512  if (unlikely(Py_SIZE(x) < 0)) {
28513  goto raise_neg_overflow;
28514  }
28515 #else
28516  {
28517  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28518  if (unlikely(result < 0))
28519  return (long) -1;
28520  if (unlikely(result == 1))
28521  goto raise_neg_overflow;
28522  }
28523 #endif
28524  if (sizeof(long) <= sizeof(unsigned long)) {
28525  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28526 #ifdef HAVE_LONG_LONG
28527  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28528  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28529 #endif
28530  }
28531  } else {
28532 #if CYTHON_USE_PYLONG_INTERNALS
28533  const digit* digits = ((PyLongObject*)x)->ob_digit;
28534  switch (Py_SIZE(x)) {
28535  case 0: return (long) 0;
28536  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28537  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28538  case -2:
28539  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28540  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28541  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28542  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28543  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28544  }
28545  }
28546  break;
28547  case 2:
28548  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28549  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28550  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28551  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28552  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28553  }
28554  }
28555  break;
28556  case -3:
28557  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28558  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28559  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28560  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28561  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28562  }
28563  }
28564  break;
28565  case 3:
28566  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28567  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28568  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28569  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28570  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28571  }
28572  }
28573  break;
28574  case -4:
28575  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28576  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28577  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28578  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28579  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28580  }
28581  }
28582  break;
28583  case 4:
28584  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28585  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28586  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28587  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28588  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28589  }
28590  }
28591  break;
28592  }
28593 #endif
28594  if (sizeof(long) <= sizeof(long)) {
28595  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28596 #ifdef HAVE_LONG_LONG
28597  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28598  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28599 #endif
28600  }
28601  }
28602  {
28603 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28604  PyErr_SetString(PyExc_RuntimeError,
28605  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28606 #else
28607  long val;
28608  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28609  #if PY_MAJOR_VERSION < 3
28610  if (likely(v) && !PyLong_Check(v)) {
28611  PyObject *tmp = v;
28612  v = PyNumber_Long(tmp);
28613  Py_DECREF(tmp);
28614  }
28615  #endif
28616  if (likely(v)) {
28617  int one = 1; int is_little = (int)*(unsigned char *)&one;
28618  unsigned char *bytes = (unsigned char *)&val;
28619  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28620  bytes, sizeof(val),
28621  is_little, !is_unsigned);
28622  Py_DECREF(v);
28623  if (likely(!ret))
28624  return val;
28625  }
28626 #endif
28627  return (long) -1;
28628  }
28629  } else {
28630  long val;
28631  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28632  if (!tmp) return (long) -1;
28633  val = __Pyx_PyInt_As_long(tmp);
28634  Py_DECREF(tmp);
28635  return val;
28636  }
28637 raise_overflow:
28638  PyErr_SetString(PyExc_OverflowError,
28639  "value too large to convert to long");
28640  return (long) -1;
28641 raise_neg_overflow:
28642  PyErr_SetString(PyExc_OverflowError,
28643  "can't convert negative value to long");
28644  return (long) -1;
28645 }
28646 
28647 /* CIntToPy */
28648  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28649  const long neg_one = (long) -1, const_zero = (long) 0;
28650  const int is_unsigned = neg_one > const_zero;
28651  if (is_unsigned) {
28652  if (sizeof(long) < sizeof(long)) {
28653  return PyInt_FromLong((long) value);
28654  } else if (sizeof(long) <= sizeof(unsigned long)) {
28655  return PyLong_FromUnsignedLong((unsigned long) value);
28656 #ifdef HAVE_LONG_LONG
28657  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28658  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28659 #endif
28660  }
28661  } else {
28662  if (sizeof(long) <= sizeof(long)) {
28663  return PyInt_FromLong((long) value);
28664 #ifdef HAVE_LONG_LONG
28665  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28666  return PyLong_FromLongLong((PY_LONG_LONG) value);
28667 #endif
28668  }
28669  }
28670  {
28671  int one = 1; int little = (int)*(unsigned char *)&one;
28672  unsigned char *bytes = (unsigned char *)&value;
28673  return _PyLong_FromByteArray(bytes, sizeof(long),
28674  little, !is_unsigned);
28675  }
28676 }
28677 
28678 /* CIntFromPy */
28679  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28680  const char neg_one = (char) -1, const_zero = (char) 0;
28681  const int is_unsigned = neg_one > const_zero;
28682 #if PY_MAJOR_VERSION < 3
28683  if (likely(PyInt_Check(x))) {
28684  if (sizeof(char) < sizeof(long)) {
28685  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28686  } else {
28687  long val = PyInt_AS_LONG(x);
28688  if (is_unsigned && unlikely(val < 0)) {
28689  goto raise_neg_overflow;
28690  }
28691  return (char) val;
28692  }
28693  } else
28694 #endif
28695  if (likely(PyLong_Check(x))) {
28696  if (is_unsigned) {
28697 #if CYTHON_USE_PYLONG_INTERNALS
28698  const digit* digits = ((PyLongObject*)x)->ob_digit;
28699  switch (Py_SIZE(x)) {
28700  case 0: return (char) 0;
28701  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28702  case 2:
28703  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28704  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28705  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28706  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28707  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28708  }
28709  }
28710  break;
28711  case 3:
28712  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28713  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28714  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28715  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28716  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28717  }
28718  }
28719  break;
28720  case 4:
28721  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28722  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28723  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28724  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28725  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28726  }
28727  }
28728  break;
28729  }
28730 #endif
28731 #if CYTHON_COMPILING_IN_CPYTHON
28732  if (unlikely(Py_SIZE(x) < 0)) {
28733  goto raise_neg_overflow;
28734  }
28735 #else
28736  {
28737  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28738  if (unlikely(result < 0))
28739  return (char) -1;
28740  if (unlikely(result == 1))
28741  goto raise_neg_overflow;
28742  }
28743 #endif
28744  if (sizeof(char) <= sizeof(unsigned long)) {
28745  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28746 #ifdef HAVE_LONG_LONG
28747  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28748  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28749 #endif
28750  }
28751  } else {
28752 #if CYTHON_USE_PYLONG_INTERNALS
28753  const digit* digits = ((PyLongObject*)x)->ob_digit;
28754  switch (Py_SIZE(x)) {
28755  case 0: return (char) 0;
28756  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28757  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28758  case -2:
28759  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28760  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28761  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28762  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28763  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28764  }
28765  }
28766  break;
28767  case 2:
28768  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28769  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28770  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28771  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28772  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28773  }
28774  }
28775  break;
28776  case -3:
28777  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28778  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28779  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28780  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28781  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28782  }
28783  }
28784  break;
28785  case 3:
28786  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28787  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28788  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28789  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28790  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28791  }
28792  }
28793  break;
28794  case -4:
28795  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28796  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28797  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28798  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28799  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28800  }
28801  }
28802  break;
28803  case 4:
28804  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28805  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28806  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28807  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28808  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28809  }
28810  }
28811  break;
28812  }
28813 #endif
28814  if (sizeof(char) <= sizeof(long)) {
28815  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28816 #ifdef HAVE_LONG_LONG
28817  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28818  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28819 #endif
28820  }
28821  }
28822  {
28823 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28824  PyErr_SetString(PyExc_RuntimeError,
28825  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28826 #else
28827  char val;
28828  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28829  #if PY_MAJOR_VERSION < 3
28830  if (likely(v) && !PyLong_Check(v)) {
28831  PyObject *tmp = v;
28832  v = PyNumber_Long(tmp);
28833  Py_DECREF(tmp);
28834  }
28835  #endif
28836  if (likely(v)) {
28837  int one = 1; int is_little = (int)*(unsigned char *)&one;
28838  unsigned char *bytes = (unsigned char *)&val;
28839  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28840  bytes, sizeof(val),
28841  is_little, !is_unsigned);
28842  Py_DECREF(v);
28843  if (likely(!ret))
28844  return val;
28845  }
28846 #endif
28847  return (char) -1;
28848  }
28849  } else {
28850  char val;
28851  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28852  if (!tmp) return (char) -1;
28853  val = __Pyx_PyInt_As_char(tmp);
28854  Py_DECREF(tmp);
28855  return val;
28856  }
28857 raise_overflow:
28858  PyErr_SetString(PyExc_OverflowError,
28859  "value too large to convert to char");
28860  return (char) -1;
28861 raise_neg_overflow:
28862  PyErr_SetString(PyExc_OverflowError,
28863  "can't convert negative value to char");
28864  return (char) -1;
28865 }
28866 
28867 /* CheckBinaryVersion */
28868  static int __Pyx_check_binary_version(void) {
28869  char ctversion[4], rtversion[4];
28870  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28871  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
28872  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28873  char message[200];
28874  PyOS_snprintf(message, sizeof(message),
28875  "compiletime version %s of module '%.100s' "
28876  "does not match runtime version %s",
28877  ctversion, __Pyx_MODULE_NAME, rtversion);
28878  return PyErr_WarnEx(NULL, message, 1);
28879  }
28880  return 0;
28881 }
28882 
28883 /* ModuleImport */
28884  #ifndef __PYX_HAVE_RT_ImportModule
28885 #define __PYX_HAVE_RT_ImportModule
28886 static PyObject *__Pyx_ImportModule(const char *name) {
28887  PyObject *py_name = 0;
28888  PyObject *py_module = 0;
28889  py_name = __Pyx_PyIdentifier_FromString(name);
28890  if (!py_name)
28891  goto bad;
28892  py_module = PyImport_Import(py_name);
28893  Py_DECREF(py_name);
28894  return py_module;
28895 bad:
28896  Py_XDECREF(py_name);
28897  return 0;
28898 }
28899 #endif
28900 
28901 /* TypeImport */
28902  #ifndef __PYX_HAVE_RT_ImportType
28903 #define __PYX_HAVE_RT_ImportType
28904 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
28905  size_t size, int strict)
28906 {
28907  PyObject *py_module = 0;
28908  PyObject *result = 0;
28909  PyObject *py_name = 0;
28910  char warning[200];
28911  Py_ssize_t basicsize;
28912 #ifdef Py_LIMITED_API
28913  PyObject *py_basicsize;
28914 #endif
28915  py_module = __Pyx_ImportModule(module_name);
28916  if (!py_module)
28917  goto bad;
28918  py_name = __Pyx_PyIdentifier_FromString(class_name);
28919  if (!py_name)
28920  goto bad;
28921  result = PyObject_GetAttr(py_module, py_name);
28922  Py_DECREF(py_name);
28923  py_name = 0;
28924  Py_DECREF(py_module);
28925  py_module = 0;
28926  if (!result)
28927  goto bad;
28928  if (!PyType_Check(result)) {
28929  PyErr_Format(PyExc_TypeError,
28930  "%.200s.%.200s is not a type object",
28931  module_name, class_name);
28932  goto bad;
28933  }
28934 #ifndef Py_LIMITED_API
28935  basicsize = ((PyTypeObject *)result)->tp_basicsize;
28936 #else
28937  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
28938  if (!py_basicsize)
28939  goto bad;
28940  basicsize = PyLong_AsSsize_t(py_basicsize);
28941  Py_DECREF(py_basicsize);
28942  py_basicsize = 0;
28943  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
28944  goto bad;
28945 #endif
28946  if (!strict && (size_t)basicsize > size) {
28947  PyOS_snprintf(warning, sizeof(warning),
28948  "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
28949  module_name, class_name, basicsize, size);
28950  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
28951  }
28952  else if ((size_t)basicsize != size) {
28953  PyErr_Format(PyExc_ValueError,
28954  "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
28955  module_name, class_name, basicsize, size);
28956  goto bad;
28957  }
28958  return (PyTypeObject *)result;
28959 bad:
28960  Py_XDECREF(py_module);
28961  Py_XDECREF(result);
28962  return NULL;
28963 }
28964 #endif
28965 
28966 /* InitStrings */
28967  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28968  while (t->p) {
28969  #if PY_MAJOR_VERSION < 3
28970  if (t->is_unicode) {
28971  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28972  } else if (t->intern) {
28973  *t->p = PyString_InternFromString(t->s);
28974  } else {
28975  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28976  }
28977  #else
28978  if (t->is_unicode | t->is_str) {
28979  if (t->intern) {
28980  *t->p = PyUnicode_InternFromString(t->s);
28981  } else if (t->encoding) {
28982  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28983  } else {
28984  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28985  }
28986  } else {
28987  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28988  }
28989  #endif
28990  if (!*t->p)
28991  return -1;
28992  if (PyObject_Hash(*t->p) == -1)
28993  return -1;
28994  ++t;
28995  }
28996  return 0;
28997 }
28998 
28999 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29000  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29001 }
29002 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29003  Py_ssize_t ignore;
29004  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29005 }
29006 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29007 #if !CYTHON_PEP393_ENABLED
29008 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29009  char* defenc_c;
29010  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29011  if (!defenc) return NULL;
29012  defenc_c = PyBytes_AS_STRING(defenc);
29013 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29014  {
29015  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29016  char* c;
29017  for (c = defenc_c; c < end; c++) {
29018  if ((unsigned char) (*c) >= 128) {
29019  PyUnicode_AsASCIIString(o);
29020  return NULL;
29021  }
29022  }
29023  }
29024 #endif
29025  *length = PyBytes_GET_SIZE(defenc);
29026  return defenc_c;
29027 }
29028 #else
29029 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29030  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29031 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29032  if (likely(PyUnicode_IS_ASCII(o))) {
29033  *length = PyUnicode_GET_LENGTH(o);
29034  return PyUnicode_AsUTF8(o);
29035  } else {
29036  PyUnicode_AsASCIIString(o);
29037  return NULL;
29038  }
29039 #else
29040  return PyUnicode_AsUTF8AndSize(o, length);
29041 #endif
29042 }
29043 #endif
29044 #endif
29045 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29046 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29047  if (
29048 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29049  __Pyx_sys_getdefaultencoding_not_ascii &&
29050 #endif
29051  PyUnicode_Check(o)) {
29052  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29053  } else
29054 #endif
29055 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29056  if (PyByteArray_Check(o)) {
29057  *length = PyByteArray_GET_SIZE(o);
29058  return PyByteArray_AS_STRING(o);
29059  } else
29060 #endif
29061  {
29062  char* result;
29063  int r = PyBytes_AsStringAndSize(o, &result, length);
29064  if (unlikely(r < 0)) {
29065  return NULL;
29066  } else {
29067  return result;
29068  }
29069  }
29070 }
29071 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29072  int is_true = x == Py_True;
29073  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29074  else return PyObject_IsTrue(x);
29075 }
29076 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29077 #if PY_MAJOR_VERSION >= 3
29078  if (PyLong_Check(result)) {
29079  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29080  "__int__ returned non-int (type %.200s). "
29081  "The ability to return an instance of a strict subclass of int "
29082  "is deprecated, and may be removed in a future version of Python.",
29083  Py_TYPE(result)->tp_name)) {
29084  Py_DECREF(result);
29085  return NULL;
29086  }
29087  return result;
29088  }
29089 #endif
29090  PyErr_Format(PyExc_TypeError,
29091  "__%.4s__ returned non-%.4s (type %.200s)",
29092  type_name, type_name, Py_TYPE(result)->tp_name);
29093  Py_DECREF(result);
29094  return NULL;
29095 }
29096 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29097 #if CYTHON_USE_TYPE_SLOTS
29098  PyNumberMethods *m;
29099 #endif
29100  const char *name = NULL;
29101  PyObject *res = NULL;
29102 #if PY_MAJOR_VERSION < 3
29103  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29104 #else
29105  if (likely(PyLong_Check(x)))
29106 #endif
29107  return __Pyx_NewRef(x);
29108 #if CYTHON_USE_TYPE_SLOTS
29109  m = Py_TYPE(x)->tp_as_number;
29110  #if PY_MAJOR_VERSION < 3
29111  if (m && m->nb_int) {
29112  name = "int";
29113  res = m->nb_int(x);
29114  }
29115  else if (m && m->nb_long) {
29116  name = "long";
29117  res = m->nb_long(x);
29118  }
29119  #else
29120  if (likely(m && m->nb_int)) {
29121  name = "int";
29122  res = m->nb_int(x);
29123  }
29124  #endif
29125 #else
29126  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29127  res = PyNumber_Int(x);
29128  }
29129 #endif
29130  if (likely(res)) {
29131 #if PY_MAJOR_VERSION < 3
29132  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29133 #else
29134  if (unlikely(!PyLong_CheckExact(res))) {
29135 #endif
29136  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29137  }
29138  }
29139  else if (!PyErr_Occurred()) {
29140  PyErr_SetString(PyExc_TypeError,
29141  "an integer is required");
29142  }
29143  return res;
29144 }
29145 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29146  Py_ssize_t ival;
29147  PyObject *x;
29148 #if PY_MAJOR_VERSION < 3
29149  if (likely(PyInt_CheckExact(b))) {
29150  if (sizeof(Py_ssize_t) >= sizeof(long))
29151  return PyInt_AS_LONG(b);
29152  else
29153  return PyInt_AsSsize_t(x);
29154  }
29155 #endif
29156  if (likely(PyLong_CheckExact(b))) {
29157  #if CYTHON_USE_PYLONG_INTERNALS
29158  const digit* digits = ((PyLongObject*)b)->ob_digit;
29159  const Py_ssize_t size = Py_SIZE(b);
29160  if (likely(__Pyx_sst_abs(size) <= 1)) {
29161  ival = likely(size) ? digits[0] : 0;
29162  if (size == -1) ival = -ival;
29163  return ival;
29164  } else {
29165  switch (size) {
29166  case 2:
29167  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29168  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29169  }
29170  break;
29171  case -2:
29172  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29173  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29174  }
29175  break;
29176  case 3:
29177  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29178  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29179  }
29180  break;
29181  case -3:
29182  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29183  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29184  }
29185  break;
29186  case 4:
29187  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29188  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29189  }
29190  break;
29191  case -4:
29192  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29193  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29194  }
29195  break;
29196  }
29197  }
29198  #endif
29199  return PyLong_AsSsize_t(b);
29200  }
29201  x = PyNumber_Index(b);
29202  if (!x) return -1;
29203  ival = PyInt_AsSsize_t(x);
29204  Py_DECREF(x);
29205  return ival;
29206 }
29207 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29208  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29209 }
29210 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29211  return PyInt_FromSize_t(ival);
29212 }
29213 
29214 
29215 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
ns
Int ns
Definition: Headers.h:30
c
Double c
Definition: Headers.h:54
proteus_superlu.h
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
nnz
#define nnz
Definition: Richards.h:7